summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Blechmann <tim@klingt.org>2022-03-24 09:40:40 +0800
committerTim Blechmann <tim@klingt.org>2022-03-25 12:02:14 +0800
commit837bfd6f145402c94570d1df4fb3446664cb7828 (patch)
tree4f0230945efe630a609eba5f3520054df1ed6054
parent7d8150da4c20e1f9165e3c2642a183446220dd04 (diff)
cmake: skip unity build inclusion of generated resources
generated resource files contain static variables like `qt_resource_data`. if multiple resources are included in unity builds, we end up with name clashes, so we should exclude them Change-Id: I8cbe73a9e3ce3808a142b7cb6315355a7d4161db Pick-to: 6.2 6.3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--src/corelib/Qt6CoreMacros.cmake7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake
index 77fc875b6f..6d1ca2a0b4 100644
--- a/src/corelib/Qt6CoreMacros.cmake
+++ b/src/corelib/Qt6CoreMacros.cmake
@@ -377,8 +377,10 @@ function(qt6_add_resources outfiles )
MAIN_DEPENDENCY ${infile}
DEPENDS ${_rc_depends} "${_out_depends}" ${QT_CMAKE_EXPORT_NAMESPACE}::rcc
VERBATIM)
- set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC ON)
- set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOUIC ON)
+ set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC ON
+ SKIP_AUTOUIC ON
+ SKIP_UNITY_BUILD_INCLUSION ON
+ )
list(APPEND ${outfiles} ${outfile})
endforeach()
set(${outfiles} ${${outfiles}} PARENT_SCOPE)
@@ -2017,6 +2019,7 @@ function(_qt_internal_process_resource target resourceName)
set_source_files_properties(${generatedOutfile} ${scope_args} PROPERTIES
SKIP_AUTOGEN TRUE
GENERATED TRUE
+ SKIP_UNITY_BUILD_INCLUSION TRUE
)
get_target_property(target_source_dir ${target} SOURCE_DIR)
if(NOT target_source_dir STREQUAL CMAKE_CURRENT_SOURCE_DIR)