summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2021-06-21 14:15:02 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-06-21 16:11:47 +0000
commit339707fbf03aaaf1729fbd35093e1458235c74e0 (patch)
tree252c137adc40c3737e890d9138e1846dac65c863 /src
parent322f7c5a49c5666f816d6783717661a25e7a121a (diff)
Do not apply not acceptable properties to the imported object libraries
If __qt_internal_propagate_object_library is used to propagate an imported object library we assume that the library is already compiled and no need to apply properties that may affect compiling and further linking of the target. Amends 3329212815777e33dfb4697b748d10927d73f44c Change-Id: I2bd03264e286439fbed9067fa2c0a5c4a0097856 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit d49f19e66107f6f56271e32284ee952af598ff1b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/Qt6CoreMacros.cmake15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake
index 88bf5052bf..81b98195ea 100644
--- a/src/corelib/Qt6CoreMacros.cmake
+++ b/src/corelib/Qt6CoreMacros.cmake
@@ -1423,8 +1423,11 @@ function(__qt_internal_propagate_object_library target object_library)
set(multi_args EXTRA_CONDITIONS)
cmake_parse_arguments(arg "${options}" "${single_args}" "${multi_args}" ${ARGN})
- target_link_libraries(${object_library} PRIVATE ${QT_CMAKE_EXPORT_NAMESPACE}::Platform)
- _qt_internal_copy_dependency_properties(${object_library} ${target} PRIVATE_ONLY)
+ get_target_property(is_imported ${object_library} IMPORTED)
+ if(NOT is_imported)
+ target_link_libraries(${object_library} PRIVATE ${QT_CMAKE_EXPORT_NAMESPACE}::Platform)
+ _qt_internal_copy_dependency_properties(${object_library} ${target} PRIVATE_ONLY)
+ endif()
# After internal discussion we decided to not rely on the linker order that CMake
# offers, until CMake provides the guaranteed linking order that suites our needs in a
@@ -1438,9 +1441,11 @@ function(__qt_internal_propagate_object_library target object_library)
# a finalizer we rely on linker to resolve circular dependencies between objects and static
# libraries.
set_property(TARGET ${object_library} PROPERTY _is_qt_propagated_object_library TRUE)
- set_property(TARGET ${object_library} APPEND PROPERTY
- EXPORT_PROPERTIES _is_qt_propagated_object_library
- )
+ if(NOT is_imported)
+ set_property(TARGET ${object_library} APPEND PROPERTY
+ EXPORT_PROPERTIES _is_qt_propagated_object_library
+ )
+ endif()
# Keep the implicit linking if finalizers are not used.
set(not_finalizer_mode_condition