diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2021-11-04 16:40:30 +0100 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2021-11-05 15:56:07 +0100 |
commit | 45ce3c6fb99e796c8dcee1d8788cb8df11308967 (patch) | |
tree | a379a1e0864c4cb54f00fd65a2ff99e8afec8cf4 /src/corelib | |
parent | 067a23f2c6f93784ffd699eedd476c82d83c430e (diff) |
Make sure that all MODULE_LIBRARY targets are built before deploying to Android
Users may add the implicit runtime depedencies to the MODULE_LIBRARY
targets, that are created using standard CMake API. When iterating a
project tree we collect all module libraries and add them as
dependencies to the qt_internal_plugins meta target. All the
${target}_make_apk targets depend on this meta target, so we can
be sure that plugins are built and present on the file system before
running androiddeployqt.
Task-number: QTBUG-94714
Task-number: QTBUG-88841
Change-Id: I4fa7f0772d23897f19db59c6e4ad38646bd3aed6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/Qt6AndroidMacros.cmake | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index 2baa764027..9ccdde0be0 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -469,9 +469,21 @@ function(_qt_internal_collect_target_apk_dependencies target) _qt_internal_collect_buildsystem_shared_libraries(libs "${CMAKE_SOURCE_DIR}") + if(NOT TARGET qt_internal_plugins) + add_custom_target(qt_internal_plugins) + endif() + foreach(lib IN LISTS libs) if(NOT lib IN_LIST apk_targets) list(APPEND extra_prefix_dirs "$<TARGET_FILE_DIR:${lib}>") + get_target_property(target_type ${lib} TYPE) + # We collect all MODULE_LIBRARY targets since target APK may have implicit dependency + # to the plugin that will cause the runtime issue. Plugins that were added using + # qt6_add_plugin should be already added to the qt_internal_plugins dependency list, + # but it's ok to re-add them. + if(target_type STREQUAL "MODULE_LIBRARY") + add_dependencies(qt_internal_plugins ${lib}) + endif() endif() endforeach() |