From eafbda41910b8bcf69223dec2b7750671b692348 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 16 Aug 2021 16:38:50 +0200 Subject: 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 --- cmake/QtFeature.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cmake') 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") -- cgit v1.2.3