summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2021-06-11 13:12:50 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-06-11 22:30:33 +0000
commitf17d8982d7ca774a45b37f78a3d4cc3ce1042217 (patch)
treeade4031883929b1387d2387a139e37a5836b67b2 /cmake
parent1e6efdf2271f95fe3f0b3cb2a2aa61d142cb4e00 (diff)
Replace flags with spaces when removing them
Removing flags based on REGEX may include spaces, so flags might be glued. Replace flags with spaces to keep at least one space for the described case. Fixes: QTBUG-94400 Change-Id: Ice268da36174ef5cf4398d2aee8fcd4731336316 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 523ee5577a3fb1801dc765511c2c76753c10a72e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtFlagHandlingHelpers.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmake/QtFlagHandlingHelpers.cmake b/cmake/QtFlagHandlingHelpers.cmake
index 0eeccce4dd..2ee41c2d66 100644
--- a/cmake/QtFlagHandlingHelpers.cmake
+++ b/cmake/QtFlagHandlingHelpers.cmake
@@ -421,7 +421,7 @@ function(qt_internal_remove_flags_impl flag_var_name flag_values IN_CACHE)
# cache variable with FORCE will overwrite the non-cache variable in this
# function scope, but we need to use the original value before that change.
foreach(flag_value IN LISTS flag_values)
- string(${replace_type} "${flag_value}" "" ${flag_var_name} "${${flag_var_name}}")
+ string(${replace_type} "${flag_value}" " " ${flag_var_name} "${${flag_var_name}}")
endforeach()
string(STRIP "${${flag_var_name}}" ${flag_var_name})
set(${flag_var_name} "${${flag_var_name}}" PARENT_SCOPE)
@@ -433,7 +433,7 @@ function(qt_internal_remove_flags_impl flag_var_name flag_values IN_CACHE)
# Work exclusively on cache variable value only.
set(mod_flags $CACHE{${flag_var_name}})
foreach(flag_value IN LISTS flag_values)
- string(${replace_type} "${flag_value}" "" mod_flags "${mod_flags}")
+ string(${replace_type} "${flag_value}" " " mod_flags "${mod_flags}")
endforeach()
string(STRIP "${mod_flags}" mod_flags)
get_property(help_text CACHE ${flag_var_name} PROPERTY HELPSTRING)