summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2023-11-06 16:57:07 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2023-11-09 20:57:44 +0100
commitf639c04f84322b9c81b11261cf14625497d78f00 (patch)
treebabc4780cfde0b381fdb56bc645b498e9a5449e8 /src/corelib/doc
parente0b09e86d83f1c6ea13b28bb2a0d627c419e46f8 (diff)
CMake: Document Android per-abi limitation of QT_ANDROID_EXTRA_LIBS
When the per-abi external projects are built, specifying a dynamic path in QT_ANDROID_EXTRA_LIBS based on CMAKE_ANDROID_ARCH_ABI would not propagate that value back to the main project's deployment json file. While the actual library files would be copied into the apk, they would not be loaded because the generated libs.xml file would be missing per-abi entries in the 'bundled_libs' array (except for the main abi). Document that project developers should explicitly specify all the libraries in the property. androiddeployqt then takes care to filter out unsupported architecture libraries in each abi build dir, but it will still copy all of them into the final apk, as well as list all the architectures in libs.xml. A proper fix would be to generate additional files with information from each per-abi external project, that would then be read by androiddeployqt (basically merge specific target property info from each sub-project). Hopefully this can be done without introducing new API. Pick-to: 6.5 6.6 Fixes: QTBUG-117206 Task-number: QTBUG-118838 Change-Id: I181a170cffdb49b0b0d455d997cfae90ada312f0 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Diffstat (limited to 'src/corelib/doc')
-rw-r--r--src/corelib/doc/src/cmake/cmake-properties.qdoc24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/corelib/doc/src/cmake/cmake-properties.qdoc b/src/corelib/doc/src/cmake/cmake-properties.qdoc
index fb167a7b11..9f474208bd 100644
--- a/src/corelib/doc/src/cmake/cmake-properties.qdoc
+++ b/src/corelib/doc/src/cmake/cmake-properties.qdoc
@@ -85,6 +85,30 @@ library to the MyApp dependencies:
add_dependencies(MyApp MyService)
\endcode
+When adding per-architecture libraries to a multi-abi project,
+list all their paths explicitly, rather than rely on variables like
+\c CMAKE_ANDROID_ARCH_ABI to dynamically compute the paths.
+
+Prefer:
+
+\badcode
+set(libs
+ ${CMAKE_CURRENT_BINARY_DIR}/libA_x86so
+ ${CMAKE_CURRENT_BINARY_DIR}/libA_x86_64.so
+ ${CMAKE_CURRENT_BINARY_DIR}/libA_arm64-v8a.so
+ ${CMAKE_CURRENT_BINARY_DIR}/libA_armeabi-v7a.so
+)
+set_target_properties(MyApp PROPERTIES QT_ANDROID_EXTRA_LIBS ${libs})
+\endcode
+
+over:
+
+\badcode
+set_target_properties(MyApp PROPERTIES
+ QT_ANDROID_EXTRA_LIBS
+ ${CMAKE_CURRENT_BINARY_DIR}/libA_${CMAKE_ANDROID_ARCH_ABI}.so
+\endcode
+
\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
*/