diff options
author | Amir Masoud Abdol <amir.abdol@qt.io> | 2023-03-15 10:46:22 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-03-16 09:20:47 +0000 |
commit | 5b1d5afb9a965ac2a2d25913cdff78a5fe6558b9 (patch) | |
tree | c06f1a25ded98e57183b4f3766eadab735a1b530 | |
parent | d17ca936cee8523b69a19c95eb3ea397b52ec30d (diff) | |
download | qtbase-5b1d5afb9a965ac2a2d25913cdff78a5fe6558b9.tar.gz |
Fix an issue with passing NO_UNITY_BUILD_SOURCES
Amend 31518f1a4e3c4a7c77ae2e008e903a849ba75dd6
Amend 360293623094a31586981206e59c92aa6235163d
Task-number: QTBUG-109394
Change-Id: Ibb2fd881c02b6496f06b8b623fa6009358755a26
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit cd12c1f33281452d478bb94744d76bead5c7363a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | cmake/QtExecutableHelpers.cmake | 10 | ||||
-rw-r--r-- | cmake/QtModuleHelpers.cmake | 10 | ||||
-rw-r--r-- | cmake/QtPluginHelpers.cmake | 20 | ||||
-rw-r--r-- | cmake/QtTargetHelpers.cmake | 4 | ||||
-rw-r--r-- | cmake/QtTestHelpers.cmake | 1 | ||||
-rw-r--r-- | cmake/QtToolHelpers.cmake | 10 |
6 files changed, 40 insertions, 15 deletions
diff --git a/cmake/QtExecutableHelpers.cmake b/cmake/QtExecutableHelpers.cmake index bd41c474eb..5efeb2a245 100644 --- a/cmake/QtExecutableHelpers.cmake +++ b/cmake/QtExecutableHelpers.cmake @@ -111,11 +111,17 @@ function(qt_internal_add_executable name) endif() if(arg_NO_UNITY_BUILD) - set(arg_NO_UNITY_BUILD NO_UNITY_BUILD) + set(arg_NO_UNITY_BUILD "NO_UNITY_BUILD") else() set(arg_NO_UNITY_BUILD "") endif() + if(arg_NO_UNITY_BUILD_SOURCES) + set(arg_NO_UNITY_BUILD_SOURCES "NO_UNITY_BUILD_SOURCES ${arg_NO_UNITY_BUILD_SOURCES}") + else() + set(arg_NO_UNITY_BUILD_SOURCES "") + endif() + qt_internal_extend_target("${name}" SOURCES ${arg_SOURCES} INCLUDE_DIRECTORIES ${private_includes} @@ -134,7 +140,7 @@ function(qt_internal_add_executable name) MOC_OPTIONS ${arg_MOC_OPTIONS} ENABLE_AUTOGEN_TOOLS ${arg_ENABLE_AUTOGEN_TOOLS} DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} - NO_UNITY_BUILD_SOURCES ${arg_NO_UNITY_BUILD_SOURCES} + ${arg_NO_UNITY_BUILD_SOURCES} ${arg_NO_UNITY_BUILD} ) set_target_properties("${name}" PROPERTIES diff --git a/cmake/QtModuleHelpers.cmake b/cmake/QtModuleHelpers.cmake index 5e7754b292..582d8294d7 100644 --- a/cmake/QtModuleHelpers.cmake +++ b/cmake/QtModuleHelpers.cmake @@ -564,11 +564,17 @@ function(qt_internal_add_module target) qt_internal_add_repo_local_defines("${target}") if(arg_NO_UNITY_BUILD) - set(arg_NO_UNITY_BUILD NO_UNITY_BUILD) + set(arg_NO_UNITY_BUILD "NO_UNITY_BUILD") else() set(arg_NO_UNITY_BUILD "") endif() + if(arg_NO_UNITY_BUILD_SOURCES) + set(arg_NO_UNITY_BUILD_SOURCES "NO_UNITY_BUILD_SOURCES ${arg_NO_UNITY_BUILD_SOURCES}") + else() + set(arg_NO_UNITY_BUILD_SOURCES "") + endif() + if(NOT arg_EXTERNAL_HEADERS) set(arg_EXTERNAL_HEADERS "") endif() @@ -604,7 +610,7 @@ function(qt_internal_add_module target) DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} PRECOMPILED_HEADER ${arg_PRECOMPILED_HEADER} NO_PCH_SOURCES ${arg_NO_PCH_SOURCES} - NO_UNITY_BUILD_SOURCES ${arg_NO_UNITY_BUILD_SOURCES} + ${arg_NO_UNITY_BUILD_SOURCES} ${arg_NO_UNITY_BUILD} ) diff --git a/cmake/QtPluginHelpers.cmake b/cmake/QtPluginHelpers.cmake index bad3cac60d..835541fe09 100644 --- a/cmake/QtPluginHelpers.cmake +++ b/cmake/QtPluginHelpers.cmake @@ -312,12 +312,6 @@ function(qt_internal_add_plugin target) endif() endif() - if(arg_NO_UNITY_BUILD) - set(arg_NO_UNITY_BUILD NO_UNITY_BUILD) - else() - set(arg_NO_UNITY_BUILD "") - endif() - set_property(TARGET "${target}" PROPERTY QT_DEFAULT_PLUGIN "${_default_plugin}") set_property(TARGET "${target}" APPEND PROPERTY EXPORT_PROPERTIES "QT_PLUGIN_CLASS_NAME;QT_PLUGIN_TYPE;QT_MODULE;QT_DEFAULT_PLUGIN") @@ -333,6 +327,18 @@ function(qt_internal_add_plugin target) ${arg_PUBLIC_INCLUDE_DIRECTORIES} ) + if(arg_NO_UNITY_BUILD) + set(arg_NO_UNITY_BUILD "NO_UNITY_BUILD") + else() + set(arg_NO_UNITY_BUILD "") + endif() + + if(arg_NO_UNITY_BUILD_SOURCES) + set(arg_NO_UNITY_BUILD_SOURCES "NO_UNITY_BUILD_SOURCES ${arg_NO_UNITY_BUILD_SOURCES}") + else() + set(arg_NO_UNITY_BUILD_SOURCES "") + endif() + qt_internal_extend_target("${target}" SOURCES ${arg_SOURCES} INCLUDE_DIRECTORIES @@ -360,7 +366,7 @@ function(qt_internal_add_plugin target) MOC_OPTIONS ${arg_MOC_OPTIONS} ENABLE_AUTOGEN_TOOLS ${arg_ENABLE_AUTOGEN_TOOLS} DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} - NO_UNITY_BUILD_SOURCES ${arg_NO_UNITY_BUILD_SOURCES} + ${arg_NO_UNITY_BUILD_SOURCES} ${arg_NO_UNITY_BUILD} ) diff --git a/cmake/QtTargetHelpers.cmake b/cmake/QtTargetHelpers.cmake index ca4faf5f67..99d1643650 100644 --- a/cmake/QtTargetHelpers.cmake +++ b/cmake/QtTargetHelpers.cmake @@ -213,11 +213,13 @@ function(qt_internal_extend_target target) ## Ignore objective-c files for PCH (not supported atm) qt_ignore_pch_obj_c_sources("${target}" "${arg_SOURCES}") - qt_update_ignore_unity_build_sources("${target}" "${arg_NO_UNITY_BUILD_SOURCES}") if(arg_NO_UNITY_BUILD) set_target_properties("${target}" PROPERTIES UNITY_BUILD OFF) qt_update_ignore_unity_build_sources("${target}" "${arg_SOURCES}") endif() + if(arg_NO_UNITY_BUILD_SOURCES) + qt_update_ignore_unity_build_sources("${target}" "${arg_NO_UNITY_BUILD_SOURCES}") + endif() else() if(QT_CMAKE_DEBUG_EXTEND_TARGET) message("qt_extend_target(${target} CONDITION ${arg_CONDITION} ...): Skipped") diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index 21a119dcf5..5a8708d3bb 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -325,7 +325,6 @@ function(qt_internal_add_test_to_batch batch_name name) ENABLE_AUTOGEN_TOOLS ${arg_ENABLE_AUTOGEN_TOOLS} DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} NO_UNITY_BUILD # Tests should not be built using UNITY_BUILD - NO_UNITY_BUILD_SOURCES ${arg_SOURCES} ) foreach(source ${arg_SOURCES}) diff --git a/cmake/QtToolHelpers.cmake b/cmake/QtToolHelpers.cmake index 92bb3dc6d1..c63828ef8c 100644 --- a/cmake/QtToolHelpers.cmake +++ b/cmake/QtToolHelpers.cmake @@ -94,11 +94,17 @@ function(qt_internal_add_tool target_name) qt_internal_library_deprecation_level(deprecation_define) if(arg_NO_UNITY_BUILD) - set(arg_NO_UNITY_BUILD NO_UNITY_BUILD) + set(arg_NO_UNITY_BUILD "NO_UNITY_BUILD") else() set(arg_NO_UNITY_BUILD "") endif() + if(arg_NO_UNITY_BUILD_SOURCES) + set(arg_NO_UNITY_BUILD_SOURCES "NO_UNITY_BUILD_SOURCES ${arg_NO_UNITY_BUILD_SOURCES}") + else() + set(arg_NO_UNITY_BUILD_SOURCES "") + endif() + qt_internal_add_executable("${target_name}" OUTPUT_DIRECTORY "${output_dir}" ${exceptions} @@ -124,7 +130,7 @@ function(qt_internal_add_tool target_name) TARGET_DESCRIPTION "${arg_TARGET_DESCRIPTION}" TARGET_COMPANY "${arg_TARGET_COMPANY}" TARGET_COPYRIGHT "${arg_TARGET_COPYRIGHT}" - NO_UNITY_BUILD_SOURCES "${arg_NO_UNITY_BUILD_SOURCES}" + ${arg_NO_UNITY_BUILD_SOURCES} ${arg_NO_UNITY_BUILD} ) qt_internal_add_target_aliases("${target_name}") |