summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2021-08-16 16:38:50 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-08-17 09:41:47 +0000
commitd74bfe5e72eb9a5d6c9daeee3459b6bd4c455de9 (patch)
tree46ae5300ef64f80b533b151ed4190dd841ce1829 /cmake
parent7be0b9e4c91abb980418fe8616bf7b286fb94ce6 (diff)
CMake: Fix feature evaluation for feature defines
Passing -DFEATURE_developer_build=TRUE did not add the define QT_BUILD_INTERNAL to src/corelib/global/qconfig.h like -DFEATURE_developer_build=ON would. This happened, because the feature evaluation in qt_evaluate_feature_definition did a string comparison against "ON". Normalize both sides of the string comparison, and thus support all booly values for features. Fixes: QTBUG-95732 Change-Id: Ibf03579c05919b35219438361fc93676b7cca7cc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit eafbda41910b8bcf69223dec2b7750671b692348) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtFeature.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake
index 6fa6cb43ba..5a2f52c7c6 100644
--- a/cmake/QtFeature.cmake
+++ b/cmake/QtFeature.cmake
@@ -492,9 +492,14 @@ function(qt_evaluate_feature_definition key)
set(expected OFF)
endif()
+ set(actual OFF)
+ if(QT_FEATURE_${arg_FEATURE})
+ set(actual ON)
+ endif()
+
set(msg "")
- if(QT_FEATURE_${arg_FEATURE} STREQUAL expected)
+ if(actual STREQUAL expected)
set(indent "")
if(arg_PREREQUISITE)
string(APPEND msg "#if ${arg_PREREQUISITE}\n")