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>
This commit is contained in:
parent
4105ff809c
commit
ed85df8008
@ -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}"
|
||||
|
@ -579,19 +579,17 @@ function(qt_internal_add_module target)
|
||||
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()
|
||||
|
||||
qt_internal_extend_target("${target}"
|
||||
${arg_NO_UNITY_BUILD}
|
||||
SOURCES
|
||||
${arg_SOURCES}
|
||||
${arg_EXTERNAL_HEADERS}
|
||||
NO_UNITY_BUILD_SOURCES
|
||||
${arg_NO_UNITY_BUILD_SOURCES}
|
||||
INCLUDE_DIRECTORIES
|
||||
${private_includes}
|
||||
SYSTEM_INCLUDE_DIRECTORIES
|
||||
@ -620,8 +618,6 @@ 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}
|
||||
${arg_NO_UNITY_BUILD_SOURCES}
|
||||
${arg_NO_UNITY_BUILD}
|
||||
)
|
||||
|
||||
# The public module define is not meant to be used when building the module itself,
|
||||
|
@ -333,14 +333,11 @@ function(qt_internal_add_plugin target)
|
||||
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}"
|
||||
${arg_NO_UNITY_BUILD}
|
||||
SOURCES ${arg_SOURCES}
|
||||
NO_UNITY_BUILD_SOURCES
|
||||
${arg_NO_UNITY_BUILD_SOURCES}
|
||||
INCLUDE_DIRECTORIES
|
||||
${private_includes}
|
||||
SYSTEM_INCLUDE_DIRECTORIES
|
||||
@ -366,8 +363,6 @@ 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}
|
||||
${arg_NO_UNITY_BUILD_SOURCES}
|
||||
${arg_NO_UNITY_BUILD}
|
||||
)
|
||||
|
||||
qt_internal_add_repo_local_defines("${target}")
|
||||
|
@ -99,17 +99,13 @@ function(qt_internal_add_tool target_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_add_executable("${target_name}"
|
||||
OUTPUT_DIRECTORY "${output_dir}"
|
||||
${exceptions}
|
||||
NO_INSTALL
|
||||
${arg_NO_UNITY_BUILD}
|
||||
SOURCES ${arg_SOURCES}
|
||||
NO_UNITY_BUILD_SOURCES ${arg_NO_UNITY_BUILD_SOURCES}
|
||||
INCLUDE_DIRECTORIES
|
||||
${arg_INCLUDE_DIRECTORIES}
|
||||
DEFINES
|
||||
@ -130,8 +126,6 @@ function(qt_internal_add_tool target_name)
|
||||
TARGET_DESCRIPTION "${arg_TARGET_DESCRIPTION}"
|
||||
TARGET_COMPANY "${arg_TARGET_COMPANY}"
|
||||
TARGET_COPYRIGHT "${arg_TARGET_COPYRIGHT}"
|
||||
${arg_NO_UNITY_BUILD_SOURCES}
|
||||
${arg_NO_UNITY_BUILD}
|
||||
)
|
||||
qt_internal_add_target_aliases("${target_name}")
|
||||
_qt_internal_apply_strict_cpp("${target_name}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user