diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2021-01-14 18:28:57 +0100 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2021-01-15 15:25:18 +0100 |
commit | 8d76903b9746a26945973391acc119e31f8d2fb8 (patch) | |
tree | 523bc8a4630696b963d76d50f364bf85131adf68 | |
parent | 154573929a76d9051920756b19ed033c4b2ac649 (diff) |
Fix missed feature evaluation errors in report
Add an optional argument to store the report command while feature
evaluation-only stage. This is necessary, because according to the
actual feature evaluation process, evaluation happens only once and it's
impossible to record any command during the evaluation-only stage.
Fixes: QTBUG-90319
Change-Id: I215fbe0a28a2661cd2d97d253b2e2c787d295cbd
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
-rw-r--r-- | cmake/QtBuildInformation.cmake | 12 | ||||
-rw-r--r-- | cmake/QtFeature.cmake | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/cmake/QtBuildInformation.cmake b/cmake/QtBuildInformation.cmake index 70467fb71b..90e45b26dd 100644 --- a/cmake/QtBuildInformation.cmake +++ b/cmake/QtBuildInformation.cmake @@ -76,9 +76,15 @@ endfunction() # Takes a list of arguments, and saves them to be evaluated at the end of the configuration # phase when the configuration summary is shown. +# +# RECORD_ON_FEATURE_EVALUATION option allows to record the command even while the feature +# evaluation-only stage. function(qt_configure_record_command) + cmake_parse_arguments(arg "RECORD_ON_FEATURE_EVALUATION" + "" + "" ${ARGV}) # Don't record commands when only evaluating features of a configure.cmake file. - if(__QtFeature_only_evaluate_features) + if(__QtFeature_only_evaluate_features AND NOT arg_RECORD_ON_FEATURE_EVALUATION) return() endif() @@ -88,7 +94,7 @@ function(qt_configure_record_command) set(command_count 0) endif() - set_property(GLOBAL PROPERTY qt_configure_command_${command_count} "${ARGV}") + set_property(GLOBAL PROPERTY qt_configure_command_${command_count} "${arg_UNPARSED_ARGUMENTS}") math(EXPR command_count "${command_count}+1") set_property(GLOBAL PROPERTY qt_configure_command_count "${command_count}") @@ -365,7 +371,7 @@ endfunction() function(qt_configure_add_report_error error) message(SEND_ERROR "${error}") - qt_configure_add_report_entry(TYPE ERROR MESSAGE "${error}" CONDITION TRUE) + qt_configure_add_report_entry(TYPE ERROR MESSAGE "${error}" CONDITION TRUE ${ARGN}) endfunction() function(qt_configure_process_add_report_entry) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 58b46c4660..b0f6352449 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -275,7 +275,7 @@ macro(qt_feature_set_value feature cache condition label conditionExpression) _qt_internal_dump_expression_values(conditionDump "${conditionExpression}") string(JOIN " " conditionString ${conditionExpression}) qt_configure_add_report_error("Feature \"${feature}\": Forcing to \"${cache}\" breaks its \ -condition:\n ${conditionString}\nCondition values dump:\n ${conditionDump}\n") +condition:\n ${conditionString}\nCondition values dump:\n ${conditionDump}\n" RECORD_ON_FEATURE_EVALUATION) endif() if (DEFINED "QT_FEATURE_${feature}") |