CMake: Print feature condition errors in configure report

Add output of feature condition error at the end of configuration
summary. Introduce qt_configure_add_report_error that may be used
to add error to end-point configure report without actual
configure interruption.

Fixes: QTBUG-88282
Change-Id: Idcf478da863ae6507438eb3370927d7d1f01e071
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Alexey Edelev 2020-12-30 13:55:18 +01:00
parent f319974488
commit 6d41d0f2b7
2 changed files with 7 additions and 2 deletions

View File

@ -362,6 +362,11 @@ function(qt_configure_add_report_entry)
qt_configure_record_command(ADD_REPORT_ENTRY ${ARGV})
endfunction()
function(qt_configure_add_report_error error)
message(SEND_ERROR "${error}")
qt_configure_add_report_entry(TYPE ERROR MESSAGE "${error}" CONDITION TRUE)
endfunction()
function(qt_configure_process_add_report_entry)
qt_parse_all_arguments(arg "qt_configure_add_report_entry"
""

View File

@ -274,8 +274,8 @@ macro(qt_feature_set_value feature cache condition label conditionExpression)
if (NOT (condition) AND (cache))
_qt_internal_dump_expression_values(conditionDump "${conditionExpression}")
string(JOIN " " conditionString ${conditionExpression})
message(SEND_ERROR "Feature \"${feature}\": Forcing to \"${cache}\" breaks its condition:\
\n ${conditionString}\nCondition values dump:\n ${conditionDump}\n")
qt_configure_add_report_error("Feature \"${feature}\": Forcing to \"${cache}\" breaks its \
condition:\n ${conditionString}\nCondition values dump:\n ${conditionDump}\n")
endif()
if (DEFINED "QT_FEATURE_${feature}")