summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2021-03-29 16:46:19 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-04-14 15:40:19 +0000
commitc2a06dee19b5127c315e85fd3e2aa45691ede0da (patch)
treec54178e1ea17e990146fe2a39d4598bbaf7864c7
parentfa2efb8b3577c69fee305c0d74f6996bbf84bd7a (diff)
Add missing compile definitions to the resource object library
The resource object library must be compiled with the definitions specified in Qt::Core. Missing the required definitions causes linker problems when QT_NAMESPACE is defined. Change-Id: If0ca20604e251822279e0d4906c47b94d3b4ceb4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 9466b3629a391ae93c4f06d3627e3dc9e10bba9f) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r--src/corelib/Qt6CoreMacros.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake
index 7a8fe80671..a74b212ab2 100644
--- a/src/corelib/Qt6CoreMacros.cmake
+++ b/src/corelib/Qt6CoreMacros.cmake
@@ -1106,6 +1106,9 @@ function(__qt_propagate_generated_resource target resource_name generated_source
set(resource_target "${target}_resources_${resource_count}")
add_library("${resource_target}" OBJECT "${generated_source_code}")
+ target_compile_definitions("${resource_target}" PRIVATE
+ "$<TARGET_PROPERTY:${QT_CMAKE_EXPORT_NAMESPACE}::Core,INTERFACE_COMPILE_DEFINITIONS>"
+ )
set_property(TARGET ${resource_target} APPEND PROPERTY _qt_resource_name ${resource_name})
# Save the path to the generated source file, relative to the the current build dir.