From 7bf268114d2806897c7edb6ef01e388c07d368fe Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Sat, 4 Sep 2021 23:21:56 +0300 Subject: [PATCH] Fix issue with deploy step not getting valid abi with CMake With CMake, it seems that the abi was being empty string because looking for ANDROID_ABIS is not defined and instead there's ANDROID_ABI. Also make sure to handle the case of ANDROID_ABIS, which might be declared in future versions like Qt 6.3 which can support multi-abi builds. Change-Id: I805c5c25409a4e20a237b8747082d256bd72e275 Reviewed-by: Alessandro Portale --- src/plugins/android/androiddeployqtstep.cpp | 8 ++++++-- src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp index 1b62dcf717b..9e9c85b70f1 100644 --- a/src/plugins/android/androiddeployqtstep.cpp +++ b/src/plugins/android/androiddeployqtstep.cpp @@ -155,11 +155,15 @@ bool AndroidDeployQtStep::init() if (!info.isValid()) // aborted return false; + const BuildSystem *bs = buildSystem(); + auto selectedAbis = bs->property(Constants::ANDROID_ABIS).toStringList(); + const QString buildKey = target()->activeBuildKey(); - auto selectedAbis = buildSystem()->property(Constants::ANDROID_ABIS).toStringList(); + if (selectedAbis.isEmpty()) + selectedAbis = bs->extraData(buildKey, Constants::ANDROID_ABIS).toStringList(); if (selectedAbis.isEmpty()) - selectedAbis = buildSystem()->extraData(buildKey, Constants::ANDROID_ABIS).toStringList(); + selectedAbis.append(bs->extraData(buildKey, Constants::AndroidArch).toString()); const QtSupport::BaseQtVersion * const qt = QtSupport::QtKitAspect::qtVersion(kit()); if (qt && qt->supportsMultipleQtAbis() && !selectedAbis.contains(info.cpuAbi.first())) { diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp index 11d82aeae40..6c84e3d8729 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp @@ -143,6 +143,9 @@ QVariant CMakeTargetNode::data(Utils::Id role) const if (role == Android::Constants::AndroidArch) return value(Android::Constants::ANDROID_ABI); + if (role == Android::Constants::ANDROID_ABIS) + return value(Android::Constants::ANDROID_ABIS); + if (role == Android::Constants::AndroidSoLibPath) return values(Android::Constants::ANDROID_SO_LIBS_PATHS);