summaryrefslogtreecommitdiffstats
path: root/cmake/QtExecutableHelpers.cmake
diff options
context:
space:
mode:
authorAmir Masoud Abdol <amir.abdol@qt.io>2023-03-29 11:38:30 +0200
committerAmir Masoud Abdol <amir.abdol@qt.io>2023-04-03 10:41:13 +0000
commited85df800838383dc7cad5a7c82fd9a99a6392c8 (patch)
treea88dfb0db08918ac5056b3dbdd8c0a12c2fac11c /cmake/QtExecutableHelpers.cmake
parent4105ff809c8dbf1acf21d909549db4fd5faa0613 (diff)
Improvement to NO_UNITY_BUILD_SOURCES, and fix related bugs
The source of the problem was in `qt_set_target_info_properties` which was not able to process the NO_UNITY_BUILD_SOURCES, and therefore leaking it into the `TARGET_COPYRIGHT`, ie., the last argument. So, I decided to pass Unity Build arguments before them, and closer to SOURCES, which is nicer to read, and avoid similar situation. And I reverted the work around in the amend commit, and passing the arguments normally. This happens because we pass an unfiltered ${ARGN} from qt_internal_add_executable to qt_set_target_info_properties and that the current change is merely a workaround that ensures they get circumstantially filtered out, because the NO_UNITY_BUILD_SOURCES option appears before any of the first TARGET_ props. Amend cd12c1f33281452d478bb94744d76bead5c7363a Task-number: QTBUG-99238 Task-number: QTBUG-109394 Pick-to: 6.5 Change-Id: Idb37937cf53e708425402c90f55bda8816e27f29 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtExecutableHelpers.cmake')
-rw-r--r--cmake/QtExecutableHelpers.cmake10
1 files changed, 2 insertions, 8 deletions
diff --git a/cmake/QtExecutableHelpers.cmake b/cmake/QtExecutableHelpers.cmake
index 5efeb2a245..a556dca6c1 100644
--- a/cmake/QtExecutableHelpers.cmake
+++ b/cmake/QtExecutableHelpers.cmake
@@ -116,14 +116,10 @@ function(qt_internal_add_executable name)
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}"
+ ${arg_NO_UNITY_BUILD}
SOURCES ${arg_SOURCES}
+ NO_UNITY_BUILD_SOURCES ${arg_NO_UNITY_BUILD_SOURCES}
INCLUDE_DIRECTORIES ${private_includes}
DEFINES ${arg_DEFINES}
LIBRARIES
@@ -140,8 +136,6 @@ 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}
- ${arg_NO_UNITY_BUILD_SOURCES}
- ${arg_NO_UNITY_BUILD}
)
set_target_properties("${name}" PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${arg_OUTPUT_DIRECTORY}"