configure: Fix error when turning on/off non-emitted features
Features that are not emitted in the current configuration (e.g. plugin-manifests on Linux) should not yield an error. Instead, print a warning message like Qt5's configure did. Set insignificant feature to OFF. Remove the now unneeded emit_if parameter from qt_feature_set_cache_value. Fixes: QTBUG-88305 Change-Id: I0f2ce152fca5f08417038c9bd2c07639ff6a3df4 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit c4f5762b20dc20bab3cc62e9166d0e5b36e21cc6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
e591f14117
commit
ebd4d0cbf4
@ -227,13 +227,8 @@ function(_qt_internal_dump_expression_values expression_dump expression)
|
|||||||
set(${expression_dump} "${${expression_dump}}" PARENT_SCOPE)
|
set(${expression_dump} "${${expression_dump}}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(qt_feature_set_cache_value resultVar feature emit_if condition calculated label)
|
function(qt_feature_set_cache_value resultVar feature condition calculated label)
|
||||||
if (DEFINED "FEATURE_${feature}")
|
if (DEFINED "FEATURE_${feature}")
|
||||||
# Must set up the cache
|
|
||||||
if (NOT (emit_if))
|
|
||||||
message(FATAL_ERROR "Sanity check failed: FEATURE_${feature} that was not emitted was found in the CMakeCache.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Revisit value:
|
# Revisit value:
|
||||||
set(cache "${FEATURE_${feature}}")
|
set(cache "${FEATURE_${feature}}")
|
||||||
|
|
||||||
@ -257,12 +252,8 @@ meet its condition after reconfiguration.")
|
|||||||
set("FEATURE_${feature}" "${cache}" CACHE BOOL "${label}" FORCE)
|
set("FEATURE_${feature}" "${cache}" CACHE BOOL "${label}" FORCE)
|
||||||
else()
|
else()
|
||||||
# Initial setup:
|
# Initial setup:
|
||||||
if (emit_if)
|
|
||||||
set("FEATURE_${feature}" "${calculated}" CACHE BOOL "${label}")
|
set("FEATURE_${feature}" "${calculated}" CACHE BOOL "${label}")
|
||||||
set(result "${calculated}")
|
set(result "${calculated}")
|
||||||
else()
|
|
||||||
set(result OFF)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set("${resultVar}" "${result}" PARENT_SCOPE)
|
set("${resultVar}" "${result}" PARENT_SCOPE)
|
||||||
@ -350,8 +341,17 @@ function(qt_evaluate_feature feature)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
qt_feature_set_cache_value(cache "${feature}" "${emit_if}" "${condition}" "${result}"
|
if(NOT emit_if AND DEFINED FEATURE_${feature})
|
||||||
"${arg_LABEL}")
|
set(msg "")
|
||||||
|
string(APPEND msg
|
||||||
|
"Feature ${feature} is insignificant in this configuration, "
|
||||||
|
"ignoring related command line option(s).")
|
||||||
|
qt_configure_add_report_entry(TYPE WARNING MESSAGE "${msg}")
|
||||||
|
set(result OFF)
|
||||||
|
set(FEATURE_${feature} OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
qt_feature_set_cache_value(cache "${feature}" "${condition}" "${result}" "${arg_LABEL}")
|
||||||
qt_feature_set_value("${feature}" "${cache}" "${condition}" "${arg_LABEL}"
|
qt_feature_set_value("${feature}" "${cache}" "${condition}" "${arg_LABEL}"
|
||||||
"${arg_CONDITION}")
|
"${arg_CONDITION}")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user