diff options
author | Amir Masoud Abdol <amir.abdol@qt.io> | 2023-06-27 11:49:04 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-06-30 10:54:48 +0000 |
commit | 86c4d60fde0b80f065fb3391a83c52f81b3d5a5b (patch) | |
tree | fb7aad9a89e0ab1d3e14584ea499bc7ed2b36c51 | |
parent | 70f48ca973f6253c7eb5b19733515c0d319051d5 (diff) |
Update the implementation of -unity-build
I added the ability to use `-no-unity-build`, and included the
batch size in the config.summary as well. In addition, qt_feature is not
being used for `-unity-build` anymore.
Change-Id: I4a10e03d3505336d2256280ed2854ec0425df47f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f607e22d59e970f5016141ee4e70c834e64658dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | cmake/QtProcessConfigureArgs.cmake | 9 | ||||
-rw-r--r-- | configure.cmake | 16 | ||||
-rw-r--r-- | qt_cmdline.cmake | 2 |
3 files changed, 14 insertions, 13 deletions
diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake index c8f2fecdaf..d342951313 100644 --- a/cmake/QtProcessConfigureArgs.cmake +++ b/cmake/QtProcessConfigureArgs.cmake @@ -139,13 +139,6 @@ while(NOT "${configure_args}" STREQUAL "") list(POP_FRONT configure_args version) is_valid_qt_hex_version("${arg}" "${version}") push("-DQT_DISABLE_DEPRECATED_UP_TO=${version}") - elseif(arg STREQUAL "-unity-build") - push("-DQT_UNITY_BUILD=ON") - # QT_UNITY_BUILD_BATCH_SIZE will be set to 8, CMake's default. - elseif(arg STREQUAL "-unity-build-batch-size") - list(POP_FRONT configure_args unity_build_batch_size) - is_non_empty_valid_arg("${arg}" "${unity_build_batch_size}") - push("-DQT_UNITY_BUILD_BATCH_SIZE=${unity_build_batch_size}") elseif(arg STREQUAL "--") # Everything after this argument will be passed to CMake verbatim. list(APPEND cmake_args "${configure_args}") @@ -830,6 +823,8 @@ endfunction() drop_input(commercial) drop_input(confirm-license) translate_boolean_input(precompile_header BUILD_WITH_PCH) +translate_boolean_input(unity_build QT_UNITY_BUILD) +translate_string_input(unity_build_batch_size QT_UNITY_BUILD_BATCH_SIZE) translate_boolean_input(ccache QT_USE_CCACHE) translate_boolean_input(vcpkg QT_USE_VCPKG) translate_boolean_input(shared BUILD_SHARED_LIBS) diff --git a/configure.cmake b/configure.cmake index 3b5382785a..db2be5307d 100644 --- a/configure.cmake +++ b/configure.cmake @@ -1028,11 +1028,6 @@ qt_feature("ccache" CONDITION QT_USE_CCACHE ) qt_feature_config("ccache" QMAKE_PRIVATE_CONFIG) -qt_feature("unity-build" - LABEL "Unity Build" - AUTODETECT 1 - CONDITION QT_UNITY_BUILD -) qt_feature("static_runtime" LABEL "Statically link the C/C++ runtime library" AUTODETECT OFF @@ -1075,7 +1070,16 @@ qt_configure_add_summary_entry( CONDITION UNIX ) qt_configure_add_summary_entry( - ARGS "unity-build" + TYPE "message" ARGS "Unity Build" MESSAGE "yes" CONDITION QT_UNITY_BUILD +) +qt_configure_add_summary_entry( + TYPE "message" ARGS "Unity Build" MESSAGE "no" CONDITION NOT QT_UNITY_BUILD +) +qt_configure_add_summary_entry( + TYPE "message" + ARGS "Unity Build Batch Size" + MESSAGE "${QT_UNITY_BUILD_BATCH_SIZE}" + CONDITION QT_UNITY_BUILD ) qt_configure_add_summary_entry( TYPE "firstAvailableFeature" diff --git a/qt_cmdline.cmake b/qt_cmdline.cmake index bfd7b8e432..9c507906a6 100644 --- a/qt_cmdline.cmake +++ b/qt_cmdline.cmake @@ -43,6 +43,8 @@ qt_commandline_option(avx TYPE boolean) qt_commandline_option(avx2 TYPE boolean) qt_commandline_option(avx512 TYPE boolean NAME avx512f) qt_commandline_option(c++std TYPE cxxstd) +qt_commandline_option(unity-build TYPE boolean NAME unity_build) +qt_commandline_option(unity-build-batch-size TYPE string NAME unity_build_batch_size) qt_commandline_option(ccache TYPE boolean NAME ccache) qt_commandline_option(vcpkg TYPE boolean) qt_commandline_option(commercial TYPE void) |