CMake: Move dirty feature / dirty build detection into QtFeature.cmake
It makes more sense for it to live next to the other feature code. Task-number: QTBUG-96936 Task-number: QTBUG-85962 Task-number: QTBUG-112957 Task-number: QTBUG-116209 Change-Id: I8438e6fce9deaa5e709e4b0e2e1ea4eb0600a89a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit c1d2356856481b32099cfc8fd5e6fdc856ea7d31) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
b211c84505
commit
010ab170cb
@ -786,6 +786,32 @@ function(qt_feature_copy_global_config_features_to_core target)
|
|||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
function(qt_internal_detect_dirty_features)
|
||||||
|
# We need to clean up QT_FEATURE_*, but only once per configuration cycle
|
||||||
|
get_property(qt_feature_clean GLOBAL PROPERTY _qt_feature_clean)
|
||||||
|
if(NOT qt_feature_clean)
|
||||||
|
message(STATUS "Check for feature set changes")
|
||||||
|
set_property(GLOBAL PROPERTY _qt_feature_clean TRUE)
|
||||||
|
foreach(feature ${QT_KNOWN_FEATURES})
|
||||||
|
if(DEFINED "FEATURE_${feature}" AND
|
||||||
|
NOT "${QT_FEATURE_${feature}}" STREQUAL "${FEATURE_${feature}}")
|
||||||
|
message(" '${feature}' is changed from ${QT_FEATURE_${feature}} \
|
||||||
|
to ${FEATURE_${feature}}")
|
||||||
|
set(dirty_build TRUE)
|
||||||
|
endif()
|
||||||
|
unset("QT_FEATURE_${feature}" CACHE)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
set(QT_KNOWN_FEATURES "" CACHE INTERNAL "" FORCE)
|
||||||
|
|
||||||
|
if(dirty_build)
|
||||||
|
set_property(GLOBAL PROPERTY _qt_dirty_build TRUE)
|
||||||
|
message(WARNING "Re-configuring in existing build folder. \
|
||||||
|
Some features will be re-evaluated automatically.")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
function(qt_config_compile_test name)
|
function(qt_config_compile_test name)
|
||||||
if(DEFINED "TEST_${name}")
|
if(DEFINED "TEST_${name}")
|
||||||
return()
|
return()
|
||||||
|
@ -387,29 +387,7 @@ endif()
|
|||||||
|
|
||||||
option(QT_ALLOW_SYMLINK_IN_PATHS "Allows symlinks in paths." OFF)
|
option(QT_ALLOW_SYMLINK_IN_PATHS "Allows symlinks in paths." OFF)
|
||||||
|
|
||||||
# We need to clean up QT_FEATURE_*, but only once per configuration cycle
|
qt_internal_detect_dirty_features()
|
||||||
get_property(qt_feature_clean GLOBAL PROPERTY _qt_feature_clean)
|
|
||||||
if(NOT qt_feature_clean)
|
|
||||||
message(STATUS "Check for feature set changes")
|
|
||||||
set_property(GLOBAL PROPERTY _qt_feature_clean TRUE)
|
|
||||||
foreach(feature ${QT_KNOWN_FEATURES})
|
|
||||||
if(DEFINED "FEATURE_${feature}" AND
|
|
||||||
NOT "${QT_FEATURE_${feature}}" STREQUAL "${FEATURE_${feature}}")
|
|
||||||
message(" '${feature}' is changed from ${QT_FEATURE_${feature}} \
|
|
||||||
to ${FEATURE_${feature}}")
|
|
||||||
set(dirty_build TRUE)
|
|
||||||
endif()
|
|
||||||
unset("QT_FEATURE_${feature}" CACHE)
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
set(QT_KNOWN_FEATURES "" CACHE INTERNAL "" FORCE)
|
|
||||||
|
|
||||||
if(dirty_build)
|
|
||||||
set_property(GLOBAL PROPERTY _qt_dirty_build TRUE)
|
|
||||||
message(WARNING "Re-configuring in existing build folder. \
|
|
||||||
Some features will be re-evaluated automatically.")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT QT_BUILD_EXAMPLES)
|
if(NOT QT_BUILD_EXAMPLES)
|
||||||
# Disable deployment setup to avoid warnings about missing patchelf with CMake < 3.21.
|
# Disable deployment setup to avoid warnings about missing patchelf with CMake < 3.21.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user