From 0ef46b41d86b9fad4fc4a18bd577d208afa1fce8 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 7 Jul 2020 21:16:19 +0200 Subject: [PATCH] Android: Enable configuring for a single abi architecture Fixes: QTBUG-80938 Pick-to: 5.15 Change-Id: Id87202e6b2520b18c6b06b71675157f588a28bd6 Reviewed-by: Alexandru Croitor --- mkspecs/features/android/default_pre.prf | 3 +++ mkspecs/features/android/resolve_config.prf | 2 +- mkspecs/features/qt_android_deps.prf | 3 +-- mkspecs/features/qt_helper_lib.prf | 2 +- src/network/ssl/ssl.pri | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mkspecs/features/android/default_pre.prf b/mkspecs/features/android/default_pre.prf index a73cd4b39c..f7383c386c 100644 --- a/mkspecs/features/android/default_pre.prf +++ b/mkspecs/features/android/default_pre.prf @@ -8,6 +8,9 @@ build_pass:armeabi-v7a { QT_ARCH = x86 } else:build_pass:x86_64 { QT_ARCH = x86_64 +} else:count(ALL_ANDROID_ABIS, 1) { + QT_ARCH = $$ALL_ANDROID_ABIS + CONFIG += singleAndroidAbi $$QT_ARCH } else { # default architecture QT_ARCH = arm64-v8a diff --git a/mkspecs/features/android/resolve_config.prf b/mkspecs/features/android/resolve_config.prf index 0cc4e73cc9..14749abcc0 100644 --- a/mkspecs/features/android/resolve_config.prf +++ b/mkspecs/features/android/resolve_config.prf @@ -1,6 +1,6 @@ load(resolve_config) -!equals(TEMPLATE, aux):!host_build:!single_arch:!java:android { +!equals(TEMPLATE, aux):!host_build:!single_arch:!java:!singleAndroidAbi:android { isEmpty(ANDROID_ABIS): ANDROID_ABIS = $$ALL_ANDROID_ABIS ALL_ABIS = $$join(ANDROID_ABIS, _and_) diff --git a/mkspecs/features/qt_android_deps.prf b/mkspecs/features/qt_android_deps.prf index 354e40ed23..a316c59069 100644 --- a/mkspecs/features/qt_android_deps.prf +++ b/mkspecs/features/qt_android_deps.prf @@ -15,8 +15,7 @@ ANDROID_DEPENDS_DIR = $$MODULE_BASE_OUTDIR/lib/ DEPENDENCY_FILE = $$ANDROID_DEPENDS_DIR$$TARGET-android-dependencies.xml - -build_pass:!isEmpty(QT_ARCH): { +build_pass|singleAndroidAbi:!isEmpty(QT_ARCH): { !isEmpty(MODULE_PLUGIN_TYPES) { for(PLUGIN_TYPE, MODULE_PLUGIN_TYPES) { ANDROID_BUNDLED_FILES += "plugins/$$PLUGIN_TYPE" diff --git a/mkspecs/features/qt_helper_lib.prf b/mkspecs/features/qt_helper_lib.prf index 2bb01515be..56fc12015b 100644 --- a/mkspecs/features/qt_helper_lib.prf +++ b/mkspecs/features/qt_helper_lib.prf @@ -58,7 +58,7 @@ win32|CONFIG(static, static|shared) { "QMAKE_DEPENDS_$${ucmodule}_LD =$$join(LD_USES, " ", " ")" \ "QMAKE_INCDIR_$${ucmodule} = $$val_escape(MODULE_INCLUDEPATH)" \ "QMAKE_DEFINES_$${ucmodule} = $$val_escape(MODULE_DEFINES)" - android { + !singleAndroidAbi:android { MODULE_PRI_CONT += "QMAKE_LIBS_$${ucmodule} =" } else: if(msvc|qtConfig(debug_and_release)): { win32: \ diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri index 1310435eb9..590bb7f0b4 100644 --- a/src/network/ssl/ssl.pri +++ b/src/network/ssl/ssl.pri @@ -107,7 +107,7 @@ qtConfig(ssl) { qtConfig(openssl-linked): { android { - build_pass: LIBS_PRIVATE += -lssl_$${QT_ARCH} -lcrypto_$${QT_ARCH} + build_pass|singleAndroidAbi: LIBS_PRIVATE += -lssl_$${QT_ARCH} -lcrypto_$${QT_ARCH} } else: QMAKE_USE_FOR_PRIVATE += openssl } else: \ QMAKE_USE_FOR_PRIVATE += openssl/nolink