summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2021-06-21 14:15:02 +0200
committerAlexey Edelev <alexey.edelev@qt.io>2021-06-21 18:05:01 +0200
commitd49f19e66107f6f56271e32284ee952af598ff1b (patch)
tree83d2f7d97541179b673b2deda5a24eacc2eeb594 /src/corelib
parent58e4e015b50459afb505f6e949d89b5a93f29462 (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 Pick-to: 6.2 Change-Id: I2bd03264e286439fbed9067fa2c0a5c4a0097856 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/corelib')
-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