diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-07-15 13:41:15 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-07-16 09:52:26 +0200 |
commit | e0a010129059634ce6e63199081b2e2d401a4e96 (patch) | |
tree | 78cd3ed58f19881c42b054e8ac76b911e9a325d6 /cmake/QtTargetHelpers.cmake | |
parent | 3595613a0a285120b1c475e7c350a0de871e89aa (diff) |
CMake: Apply bitcode flags to internal plugin object lib initializers
All internal libraries, plugins, object libraries (resources, plugin
initializers) need to be built with bitcode flags when targeting iOS.
Internal here means all libraries added by qt_internal_add_X
functions or associated with internal libraries.
We didn't do that for plugin initializers, which were added not too
long ago.
Extract the logic that links to Qt::PlatformModuleInternal into a
separate function to be used for object libraries.
Use it for resources and plugin initializers. It will also be used
in qtdeclarative for qml plugin initializers.
Pick-to: 6.2
Task-number: QTBUG-95208
Change-Id: I366996078f5e9d1c2d2797f6b81c522ee99529e3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtTargetHelpers.cmake')
-rw-r--r-- | cmake/QtTargetHelpers.cmake | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmake/QtTargetHelpers.cmake b/cmake/QtTargetHelpers.cmake index 9c1d0c5157..75642c70b0 100644 --- a/cmake/QtTargetHelpers.cmake +++ b/cmake/QtTargetHelpers.cmake @@ -762,3 +762,13 @@ endfunction() function(qt_internal_mark_as_internal_library target) set_target_properties(${target} PROPERTIES _qt_is_internal_library TRUE) endfunction() + +function(qt_internal_link_internal_platform_for_object_library target) + # We need to apply iOS bitcode flags to object libraries that are associated with internal + # modules or plugins (e.g. object libraries added by qt_internal_add_resource, + # qt_internal_add_plugin, etc.) + # The flags are needed when building iOS apps because Xcode expects bitcode to be + # present by default. + # Achieve this by compiling the cpp files with the PlatformModuleInternal compile flags. + target_link_libraries("${target}" PRIVATE Qt::PlatformModuleInternal) +endfunction() |