diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-08-16 16:38:50 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-08-17 09:23:40 +0200 |
commit | eafbda41910b8bcf69223dec2b7750671b692348 (patch) | |
tree | 289211d032c96916e67bf21a826d726b2ecc376a /cmake | |
parent | 6dc9c8991923e9cd0bacf00a05742f0eea574ea5 (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.
Pick-to: 6.2
Fixes: QTBUG-95732
Change-Id: Ibf03579c05919b35219438361fc93676b7cca7cc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtFeature.cmake | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 576dc27b85..7fae161798 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") |