Skip to content

Commit

Permalink
Update the implementation of -unity-build
Browse files Browse the repository at this point in the history
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.

Pick-to: 6.5 6.6
Change-Id: I4a10e03d3505336d2256280ed2854ec0425df47f
Reviewed-by: Alexandru Croitor <[email protected]>
  • Loading branch information
amirmasoudabdol committed Jun 29, 2023
1 parent cd7995d commit f607e22
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
9 changes: 2 additions & 7 deletions cmake/QtProcessConfigureArgs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -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)
Expand Down
16 changes: 10 additions & 6 deletions configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1023,11 +1023,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
Expand Down Expand Up @@ -1070,7 +1065,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"
Expand Down
2 changes: 2 additions & 0 deletions qt_cmdline.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f607e22

Please sign in to comment.