From d9a7d1a89caa754b4b6b61c1d0712f978d7f2114 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 5 Feb 2021 11:16:10 +0000 Subject: [PATCH] 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 --- src/corelib/Qt6CoreMacros.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index c65203a969f..2a178de16ca 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -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_link_libraries(${target} INTERFACE + "$>") set(${output_generated_target} "${resource_target}" PARENT_SCOPE) # No need to compile Q_IMPORT_PLUGIN-containing files for non-executables.