diff options
author | Kai Köhne <kai.koehne@qt.io> | 2023-05-23 10:56:36 +0200 |
---|---|---|
committer | Kai Köhne <kai.koehne@qt.io> | 2023-10-18 14:41:33 +0200 |
commit | 3aa6f0b3961322a40f046cfb39a40d118f57216e (patch) | |
tree | c0cb3d7fe6b776134d789175a7ef50053db3c92c /cmake/QtWrapperScriptHelpers.cmake | |
parent | 885d87488ade83b37519a3b08cd968dc76a661c2 (diff) |
CMake: Use stored compiler only for qt-cmake-private
Change the heuristic only to use the stored compiler if we
are building qt itself, like with qt-cmake-private
/ qt-configure-module. qt-cmake is also used by end-users,
where the heuristic to change the compiler default base on
paths is surprising, and can go wrong.
Fixes: QTBUG-108323
Pick-to: 6.6
Change-Id: I0274e470f214a84711013d77068551f9097f4685
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'cmake/QtWrapperScriptHelpers.cmake')
-rw-r--r-- | cmake/QtWrapperScriptHelpers.cmake | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/cmake/QtWrapperScriptHelpers.cmake b/cmake/QtWrapperScriptHelpers.cmake index 628d5a77dd..9d7460fb53 100644 --- a/cmake/QtWrapperScriptHelpers.cmake +++ b/cmake/QtWrapperScriptHelpers.cmake @@ -53,15 +53,16 @@ function(qt_internal_create_wrapper_scripts) qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake-create.bat" DESTINATION "${INSTALL_BINDIR}") endif() - # Provide a private convenience wrapper with options which should not be propagated via the + # Provide a private convenience wrapper with options that should not be propagated via the # public qt-cmake wrapper e.g. CMAKE_GENERATOR. # These options can not be set in a toolchain file, but only on the command line. # These options should not be in the public wrapper, because a consumer of Qt might want to # build their CMake app with the Unix Makefiles generator, while Qt should be built with the - # Ninja generator. - # The private wrapper is more conveient for building Qt itself, because a developer doesn't need - # to specify the same options for each qt module built. - set(__qt_cmake_extra "-G\"${CMAKE_GENERATOR}\"") + # Ninja generator. In a similar vein, we do want to use the same compiler for all Qt modules, + # but not for user applications. + # The private wrapper is more convenient for building Qt itself, because a developer doesn't + # need to specify the same options for each qt module built. + set(__qt_cmake_extra "-G\"${CMAKE_GENERATOR}\" -DQT_USE_ORIGINAL_COMPILER=ON") if(generate_unix) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake.in" "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/qt-cmake-private" @ONLY @@ -231,7 +232,7 @@ function(qt_internal_create_qt_configure_tests_wrapper_script) # The script takes a path to the repo for which the standalone tests will be configured. set(script_name "qt-internal-configure-tests") - set(script_passed_args "-DQT_BUILD_STANDALONE_TESTS=ON") + set(script_passed_args "-DQT_BUILD_STANDALONE_TESTS=ON -DQT_USE_ORIGINAL_COMPILER=ON") file(RELATIVE_PATH relative_path_from_libexec_dir_to_bin_dir ${__qt_libexec_dir_absolute} |