qt5base-lts/mkspecs/features/android/resolve_config.prf
Alexandru Croitor b45533161e 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 <alessandro.portale@qt.io>
2020-08-26 01:13:32 +02:00

30 lines
1.3 KiB
Plaintext

load(resolve_config)
!equals(TEMPLATE, aux):!host_build:!single_arch:!java:!single_android_abi:android {
isEmpty(ANDROID_ABIS): ANDROID_ABIS = $$ALL_ANDROID_ABIS
ALL_ABIS = $$join(ANDROID_ABIS, _and_)
CONFIG += $$ALL_ABIS build_all
addExclusiveBuildsProper($$ALL_ABIS, $$ANDROID_ABIS)
unset(ALL_ABIS)
CONFIG += multi_android_abi
}
# single_arch is set qtConfTest_compile and is a marker that a config test is being built, and
# thus all Android ABI file name modifications should be avoided (prefix / suffix of
# the built binary).
# single_android_abi means ANDROID_ABI only has one value
# multi_android_abi means ANDROID_ABI has more than one value (Qt configured with 2+ arches)
#
# Assign $$ALL_ANDROID_ABIS to ANDROID_ABIS only if ANDROID_ABIS was not provided by the user
# on the qmake command line and Qt was not configured with 2+ arches.
#
# Note that in config.tests, ANDROID_ABIS ends up being empty (due to !single_arch check) regardless
# of how many ABIs Qt is configured with, which in turns causes the 'architectures' field in
# in android-arch-deployment-settings.json be empty.
!equals(TEMPLATE, aux):!host_build:!single_arch:!java:!multi_android_abi:android:isEmpty(ANDROID_ABIS) {
# Needed for the generated deployment-settings.json not to have an empty list
# of architectures.
ANDROID_ABIS = $$ALL_ANDROID_ABIS
}