diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-11-07 15:52:33 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-11-08 16:12:29 +0000 |
commit | 8ef64341c3227937617f78bc3fe3f6a13e78df0d (patch) | |
tree | f6f58f9ea411597d49d7faf571a8a8947ac9eb3e /cmake | |
parent | 021c17c62f963a682c6a4b19f0c3d362c28a97ee (diff) |
Fix architecture config tests values to be written only once
Every time the qtbase project was reconfigured, the list of
config tests results was appended to a cache variable which was
never reset, resulting in multiple copies of the same values
being written to QtBuildInternalsExtra.cmake.
Make sure to clean the cache variable before appending to it.
Also change the variable to be all upper-case, to be consistent
with other cache variables.
Change-Id: Ic12046730a080595e19377981a726bc330641dc1
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtBaseConfigureTests.cmake | 11 | ||||
-rw-r--r-- | cmake/QtPostProcess.cmake | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/cmake/QtBaseConfigureTests.cmake b/cmake/QtBaseConfigureTests.cmake index 2b26926bcb..bc93b84d57 100644 --- a/cmake/QtBaseConfigureTests.cmake +++ b/cmake/QtBaseConfigureTests.cmake @@ -1,6 +1,7 @@ include(CheckCXXSourceCompiles) function(run_config_test_architecture) - set(qt_base_configure_tests_vars_to_export) + set(QT_BASE_CONFIGURE_TESTS_VARS_TO_EXPORT + "" CACHE INTERNAL "Test variables that should be exported" FORCE) # Test architecture set(_arch_file "${CMAKE_CURRENT_BINARY_DIR}/architecture_test") set(saved_executable_suffix "${CMAKE_EXECUTABLE_SUFFIX}") @@ -49,16 +50,16 @@ function(run_config_test_architecture) set(TEST_architecture 1 CACHE INTERNAL "Ran the architecture test") set(TEST_architecture_arch "${_architecture}" CACHE INTERNAL "Target machine architecture") - list(APPEND qt_base_configure_tests_vars_to_export TEST_architecture_arch) + list(APPEND QT_BASE_CONFIGURE_TESTS_VARS_TO_EXPORT TEST_architecture_arch) set(TEST_subarch 1 CACHE INTERNAL "Ran machine subArchitecture test") foreach(it ${_sub_architecture}) # Equivalent to qmake's QT_CPU_FEATURES.$arch. set(TEST_arch_${TEST_architecture_arch}_subarch_${it} 1 CACHE INTERNAL "Target sub architecture result") - list(APPEND qt_base_configure_tests_vars_to_export TEST_arch_${TEST_architecture_arch}_subarch_${it}) + list(APPEND QT_BASE_CONFIGURE_TESTS_VARS_TO_EXPORT TEST_arch_${TEST_architecture_arch}_subarch_${it}) endforeach() set(TEST_buildAbi "${_build_abi}" CACHE INTERNAL "Target machine buildAbi") - list(APPEND qt_base_configure_tests_vars_to_export TEST_buildAbi) - set(qt_base_configure_tests_vars_to_export ${qt_base_configure_tests_vars_to_export} CACHE INTERNAL "Test variables that should be exported") + list(APPEND QT_BASE_CONFIGURE_TESTS_VARS_TO_EXPORT TEST_buildAbi) + set(QT_BASE_CONFIGURE_TESTS_VARS_TO_EXPORT ${QT_BASE_CONFIGURE_TESTS_VARS_TO_EXPORT} CACHE INTERNAL "Test variables that should be exported") endfunction() diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index f77cfe546e..c6b4e8c4dd 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -314,7 +314,7 @@ endfunction() function(qt_generate_build_internals_extra_cmake_code) if(PROJECT_NAME STREQUAL "QtBase") set(QT_EXTRA_BUILD_INTERNALS_VARS) - foreach(var IN LISTS qt_base_configure_tests_vars_to_export) + foreach(var IN LISTS QT_BASE_CONFIGURE_TESTS_VARS_TO_EXPORT) string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS "set(${var} \"${${var}}\" CACHE INTERNAL \"\")\n") endforeach() |