From b381775da143b8b9b5ac610bfd38485d341d7c19 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Thu, 25 Apr 2019 14:51:48 +0300 Subject: Default to the minimum supported NDK API version - android-16 will be used for 32 bit arm ABIs - android-21 will be used for all 64 bit ABIs and x86. x86 has broken wstring support in android-16 to android-19. Change-Id: I38f6e6ec3f16c172cb0b061cfc4cc9efdb8f1700 Reviewed-by: Christian Kandeler --- doc/reference/modules/android-ndk-module.qdoc | 4 +++- share/qbs/imports/qbs/Probes/AndroidNdkProbe.qbs | 4 ---- share/qbs/module-providers/Qt/templates/android_support.qbs | 2 +- share/qbs/modules/Android/ndk/ndk.qbs | 12 ++++++++++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/doc/reference/modules/android-ndk-module.qdoc b/doc/reference/modules/android-ndk-module.qdoc index d5145a67b..e3a7ca22d 100644 --- a/doc/reference/modules/android-ndk-module.qdoc +++ b/doc/reference/modules/android-ndk-module.qdoc @@ -104,5 +104,7 @@ The versioned platform name. - \defaultvalue \c{"android-16"} + \defaultvalue \c{"android-16"} for 32 bit arm ABIs + and \c{"android-21"} for all 64 bit ABIs and x86. + x86 ABI has broken wstring support in android-16 to android-19. */ diff --git a/share/qbs/imports/qbs/Probes/AndroidNdkProbe.qbs b/share/qbs/imports/qbs/Probes/AndroidNdkProbe.qbs index f7abce388..4a86ee935 100644 --- a/share/qbs/imports/qbs/Probes/AndroidNdkProbe.qbs +++ b/share/qbs/imports/qbs/Probes/AndroidNdkProbe.qbs @@ -63,7 +63,6 @@ PathProbe { property var hostArch property stringList toolchains: [] property string ndkVersion - property string ndkPlatform configure: { function readFileContent(filePath) { @@ -93,9 +92,6 @@ PathProbe { for (j in platforms) { if (File.exists(FileInfo.joinPaths(allPaths[i], "prebuilt", platforms[j]))) { path = allPaths[i]; - var ndkPlatforms = AndroidUtils.availablePlatforms(path); - if (ndkPlatforms.length > 0) - ndkPlatform = ndkPlatforms[ndkPlatforms.length - 1]; if (File.exists(FileInfo.joinPaths(path, "samples"))) samplesDir = FileInfo.joinPaths(path, "samples"); // removed in r11 hostArch = platforms[j]; diff --git a/share/qbs/module-providers/Qt/templates/android_support.qbs b/share/qbs/module-providers/Qt/templates/android_support.qbs index d11f8707a..43d9b52b4 100644 --- a/share/qbs/module-providers/Qt/templates/android_support.qbs +++ b/share/qbs/module-providers/Qt/templates/android_support.qbs @@ -40,7 +40,7 @@ Module { java._tagJniHeaders: false // prevent rule cycle } Properties { - condition: _enableNdkSupport && Android.ndk.abi === "armeabi-v7a" + condition: _enableNdkSupport && (Android.ndk.abi === "armeabi-v7a" || Android.ndk.abi === "x86") cpp.defines: "ANDROID_HAS_WSTRING" } diff --git a/share/qbs/modules/Android/ndk/ndk.qbs b/share/qbs/modules/Android/ndk/ndk.qbs index d639fcb91..15cfb8f72 100644 --- a/share/qbs/modules/Android/ndk/ndk.qbs +++ b/share/qbs/modules/Android/ndk/ndk.qbs @@ -63,8 +63,16 @@ Module { property string hostArch: ndkProbe.hostArch property string ndkDir: ndkProbe.path property string ndkSamplesDir: ndkProbe.samplesDir - property string platform: ndkProbe.ndkPlatform - + property string platform: { + switch (abi) { + case "armeabi": + case "armeabi-v7a": + // case "x86": // x86 has broken wstring support + return "android-19"; + default: + return "android-21"; + } + } property int platformVersion: { if (platform) { -- cgit v1.2.3