From b45533161e0a3c0b83c5a11e842ed970227a22de Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 14 Aug 2020 15:41:30 +0200 Subject: Android: Fix building apps when Qt is configured with one ABI When configuring with Qt only with one ABI, certain code paths were not triggered, which led to a few issues: - The deployment json file generated by androiddeployqt listed no architectures. - The compiled shared library did not have a lib prefix and arch suffix, which androiddeployqt during the deployment / make apk step. To fix the architectures missing in the json file, ANDROID_ABIS needs to be set in android/resolve_config.prf also in the single abi case. To get the correct file names, android.prf needs to apply the prefixes and suffixes not only in the build_pass case (multi-abi) but also in the single abi case (except for config.tests). The application-binary entry in the json file needs to be without the extra prefixes and suffixes though, so make a copy of the TARGET value to be used in the json file, before the name manipulations are applied. Pick-to: 5.15 Task-number: QTBUG-85399 Change-Id: Idde92ab7fe883636ccc65a87b91c8a3fc72eefbb Reviewed-by: Alessandro Portale --- mkspecs/features/android/android.prf | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mkspecs/features/android/android.prf') diff --git a/mkspecs/features/android/android.prf b/mkspecs/features/android/android.prf index 6990417536..ddb94ea22b 100644 --- a/mkspecs/features/android/android.prf +++ b/mkspecs/features/android/android.prf @@ -1,4 +1,6 @@ APK_PATH = $$shell_path($$OUT_PWD/android-build/$${TARGET}.apk) +TARGET_FOR_ANDROID_DEPLOYMENT_SETTINGS = $$TARGET + !contains(TEMPLATE, subdirs): { apk_install_target.target = apk_install_target apk_install_target.depends = first @@ -21,7 +23,12 @@ APK_PATH = $$shell_path($$OUT_PWD/android-build/$${TARGET}.apk) prepareRecursiveTarget(apk_install_target) } -build_pass { +# Apply Android arch specific settings in the following cases: +# - build_pass == true aka Qt was configured with multi-ABI (2+ arches) +# - single_android_abi == true aka Qt was configuring with a single ABI / arch +# modifications are omitted when building config.tests +# during Qt configuration, by checkking for the presence of single_arch +build_pass|if(single_android_abi:!single_arch) { contains(TEMPLATE, ".*app") { !android_app { !contains(TARGET, ".so") { -- cgit v1.2.3