aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaphael Cotty <raphael.cotty@gmail.com>2021-04-29 12:18:33 +0200
committerRaphaƫl Cotty <raphael.cotty@gmail.com>2022-02-09 22:21:11 +0000
commit2d5a48b4beaad63b82ddc00c2cad0a5226f2a898 (patch)
tree333dce8bbb954dca14448fdaf78089be35499af9
parent06fd63d8ef2e45b31a58e6ed674d78c3bc677f4a (diff)
Android: Allow to generate multi-arch package with Qt >= 6.3
In Qt 6.0, android installation was split in different directories and the androiddeployqt could not work with multiple install dir. This is fixed in Qt 6.3.0 and requires this change to call androiddeployqt. Change-Id: Ia402950fb835e956045ec28a9896c0b5cafbd9e8 Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
-rwxr-xr-xscripts/test-qt-for-android.sh6
-rw-r--r--share/qbs/module-providers/Qt/templates/android_support.qbs19
2 files changed, 24 insertions, 1 deletions
diff --git a/scripts/test-qt-for-android.sh b/scripts/test-qt-for-android.sh
index ae1338fb2..dcc52bc27 100755
--- a/scripts/test-qt-for-android.sh
+++ b/scripts/test-qt-for-android.sh
@@ -70,6 +70,12 @@ if [ ! "${QT_VERSION}" \< "5.14.0" ] && [ "${QT_VERSION}" \< "6.0.0" ]; then
tst_blackbox-android
fi;
+if [ ! "${QT_VERSION}" \< "6.3.0" ]; then
+ echo "Using multi-arch data sets for qml tests (only for qt version >= 6.3.0) with all architectures"
+ qbs config --list
+ tst_blackbox-android
+fi;
+
echo "Using single-arch (armv7a) data sets for qml tests"
qbs config --unset profiles.qbs_autotests-android-qt.qbs.architectures
qbs config profiles.qbs_autotests-android-qt.qbs.architecture armv7a
diff --git a/share/qbs/module-providers/Qt/templates/android_support.qbs b/share/qbs/module-providers/Qt/templates/android_support.qbs
index ed69e7691..68276070f 100644
--- a/share/qbs/module-providers/Qt/templates/android_support.qbs
+++ b/share/qbs/module-providers/Qt/templates/android_support.qbs
@@ -103,6 +103,7 @@ Module {
var nativeLibs = inputs["android.nativelibrary"];
var architectures = [];
var triples = [];
+ var qtInstallDirectories = [];
var hostArch;
var targetArchitecture;
if (nativeLibs.length === 1) {
@@ -112,6 +113,7 @@ Module {
if (product.Qt.android_support._multiAbi) {
architectures.push(theBinary.Android.ndk.abi);
triples.push(theBinary.cpp.toolchainTriple);
+ qtInstallDirectories.push(theBinary.Qt.android_support._qtInstallDir);
}
} else {
for (i = 0; i < nativeLibs.length; ++i) {
@@ -120,6 +122,8 @@ Module {
if (candidate.product.name === product.name) {
architectures.push(candidate.Android.ndk.abi);
triples.push(candidate.cpp.toolchainTriple);
+ qtInstallDirectories.push(
+ candidate.Qt.android_support._qtInstallDir);
hostArch = candidate.Android.ndk.hostArch;
targetArchitecture = candidate.Android.ndk.abi;
theBinary = candidate;
@@ -155,7 +159,20 @@ Module {
f.writeLine("{");
f.writeLine('"description": "This file was generated by qbs to be read by '
+ 'androiddeployqt and should not be modified by hand.",');
- f.writeLine('"qt": "' + product.Qt.android_support._qtInstallDir + '",');
+ if (Utilities.versionCompare(product.Qt.core.version, "6.3.0") >= 0) {
+ var line = '"qt": {';
+ for (var i = 0; i < qtInstallDirectories.length && i < architectures.length;
+ ++i) {
+ line = line + '"' + architectures[i] + '":"' +
+ qtInstallDirectories[i] + '"';
+ if (i < qtInstallDirectories.length-1 || i < architectures.length-1)
+ line = line + ',';
+ }
+ line = line + "},";
+ f.writeLine(line);
+ } else {
+ f.writeLine('"qt": "' + product.Qt.android_support._qtInstallDir + '",');
+ }
f.writeLine('"sdk": "' + product.Android.sdk.sdkDir + '",');
f.writeLine('"sdkBuildToolsRevision": "' + product.Android.sdk.buildToolsVersion
+ '",');