Revert "Fix static build with tests"

This reverts commit 74f549b4026710b484f17cd99dbafb074854bd11.

Reason for revert: This breaks transitive dependencies.

The object file we're adding with target_sources will not be
propagated transitively.

For example, qmltestrunner depends on QuickTest, and
QuickTest depends on Quick.
The 'qrc_scenegraph.cpp.o' object file will not be propagated to
qmltestrunner if added with target_source(Quick INTERFACE ...).

Fixes: QTBUG-90933
Pick-to: 6.0
Change-Id: I11269537ae75de14189f8b5f59094b467e2eee24
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
This commit is contained in:
Joerg Bornemann 2021-02-05 11:16:10 +00:00
parent fcb9a94f83
commit d9a7d1a89c

View File

@ -1123,9 +1123,8 @@ function(__qt_propagate_generated_resource target resource_name generated_source
# Use TARGET_NAME genex to map to the correct prefixed target name when it is exported
# via qt_install(EXPORT), so that the consumers of the target can find the object library
# as well.
target_sources(${target} INTERFACE
"$<TARGET_OBJECTS:$<TARGET_NAME:${resource_target}>>")
target_link_libraries(${target} INTERFACE
"$<TARGET_OBJECTS:$<TARGET_NAME:${resource_target}>>")
set(${output_generated_target} "${resource_target}" PARENT_SCOPE)
# No need to compile Q_IMPORT_PLUGIN-containing files for non-executables.