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>
This commit is contained in:
Alexey Edelev 2021-03-29 16:46:19 +02:00
parent 0e778b96f1
commit 9466b3629a

View File

@ -1185,6 +1185,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.