diff options
author | Raphael Cotty <raphael.cotty@gmail.com> | 2021-04-29 12:18:33 +0200 |
---|---|---|
committer | Raphaƫl Cotty <raphael.cotty@gmail.com> | 2022-02-09 22:21:11 +0000 |
commit | 2d5a48b4beaad63b82ddc00c2cad0a5226f2a898 (patch) | |
tree | 333dce8bbb954dca14448fdaf78089be35499af9 /share | |
parent | 06fd63d8ef2e45b31a58e6ed674d78c3bc677f4a (diff) | |
download | qbs-2d5a48b4beaad63b82ddc00c2cad0a5226f2a898.tar.gz |
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>
Diffstat (limited to 'share')
-rw-r--r-- | share/qbs/module-providers/Qt/templates/android_support.qbs | 19 |
1 files changed, 18 insertions, 1 deletions
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 + '",'); |