summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmir Masoud Abdol <[email protected]>2023-05-05 16:07:50 +0200
committerQt Cherry-pick Bot <[email protected]>2023-05-26 17:18:06 +0000
commite311f1182e4cd77951be9ce4fdf0287d965a99dd (patch)
treeb8830040621568b70612dcecbaa259677894c8d0
parenta95a0524a19ed16901fbbbaaebad3db2f7d3c9d7 (diff)
Make CONFIGS arguments of qt_internal_remove_compiler_flags optional
There was a discrepancy between what the comment was saying, and what the function was doing before, and with this patch, we opt for what the comment was saying, which makes more sense. In addition, I cleaned up its documentation a bit. Change-Id: I07c20f93aa5c8e9bc942f5e69f0cf8299f4a813e Reviewed-by: Joerg Bornemann <[email protected]> (cherry picked from commit 966e2561162847394d2adea5c74eb85ad1decaaf) Reviewed-by: Qt Cherry-pick Bot <[email protected]>
-rw-r--r--cmake/QtFlagHandlingHelpers.cmake23
1 files changed, 15 insertions, 8 deletions
diff --git a/cmake/QtFlagHandlingHelpers.cmake b/cmake/QtFlagHandlingHelpers.cmake
index dfeb0f7d50d..de6e917e906 100644
--- a/cmake/QtFlagHandlingHelpers.cmake
+++ b/cmake/QtFlagHandlingHelpers.cmake
@@ -558,12 +558,20 @@ endfunction()
# Removes specified flags from CMAKE_<LANGUAGES>_FLAGS[_CONFIGS] variables
#
-# IN_CACHE enables flags removal from CACHE
-# CONFIGS list of configurations that need to clear flags. Clears all configs by default if not
-# specified.
-# LANGUAGES list of LANGUAGES that need clear flags. Clears all languages by default if not
-# specified.
-# REGEX enables the flag processing as a regular expression.
+# Option Arguments:
+# IN_CACHE
+# Enables flags removal from CACHE
+# REGEX
+# Enables the flag processing as a regular expression.
+#
+# Multi-value Arguments:
+# CONFIGS
+# List of configurations that need to clear flags. Clears all configs by default if not
+# specified.
+#
+# LANGUAGES
+# List of LANGUAGES that need clear flags. Clears all languages by default if not
+# specified.
function(qt_internal_remove_compiler_flags flags)
cmake_parse_arguments(PARSE_ARGV 1 arg
"IN_CACHE;REGEX"
@@ -586,8 +594,7 @@ function(qt_internal_remove_compiler_flags flags)
if(arg_CONFIGS)
set(configs "${arg_CONFIGS}")
else()
- message(FATAL_ERROR
- "You must specify at least one configuration for which to remove the flags.")
+ qt_internal_get_configs_for_flag_manipulation(configs)
endif()
if(arg_REGEX)