From 63a0f4dc3b9cf5d091877c361e096ff176c52138 Mon Sep 17 00:00:00 2001 From: Amir Masoud Abdol Date: Thu, 1 Jun 2023 11:50:32 +0200 Subject: [PATCH] Set CMAKE__FLAGS in PARENT_SCOPE as well Previously, we were not setting the CMAKE__FLAGS, instead we were only processing the CMAKE__FLAGS_. This patch amends that so we also update the default flags list as well. Pick-to: 6.5 Change-Id: I7ceb87850a806fe8ad4eac6f8147b312eba01bc6 Reviewed-by: Alexandru Croitor --- cmake/QtFlagHandlingHelpers.cmake | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cmake/QtFlagHandlingHelpers.cmake b/cmake/QtFlagHandlingHelpers.cmake index 954ab9648d..3674abc94c 100644 --- a/cmake/QtFlagHandlingHelpers.cmake +++ b/cmake/QtFlagHandlingHelpers.cmake @@ -994,13 +994,21 @@ function(qt_internal_set_up_config_optimizations_like_in_qmake) endif() # Update all relevant flags in the calling scope - foreach(config ${configs}) - foreach(lang ${enabled_languages}) + foreach(lang ${enabled_languages}) + set(flag_var_name "CMAKE_${lang}_FLAGS") + set(${flag_var_name} "${${flag_var_name}}" PARENT_SCOPE) + + foreach(config ${configs}) set(flag_var_name "CMAKE_${lang}_FLAGS_${config}") set(${flag_var_name} "${${flag_var_name}}" PARENT_SCOPE) endforeach() + endforeach() - foreach(t ${target_link_types}) + foreach(t ${target_link_types}) + set(flag_var_name "CMAKE_${t}_LINKER_FLAGS") + set(${flag_var_name} "${${flag_var_name}}" PARENT_SCOPE) + + foreach(config ${configs}) set(flag_var_name "CMAKE_${t}_LINKER_FLAGS_${config}") set(${flag_var_name} "${${flag_var_name}}" PARENT_SCOPE) endforeach()