diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index 07365fc5dd0..d1bd01b89bc 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "abi.h" +#include "projectexplorerconstants.h" #include #include @@ -437,6 +438,18 @@ static Abis abiOf(const QByteArray &data) return result; } +static QString androidAbiFromAbi(const Abi &abi) +{ + QString androidAbi; + if (abi.architecture() == Abi::Architecture::ArmArchitecture) + androidAbi = QLatin1String(abi.wordWidth() == 64 ? Constants::ANDROID_ABI_ARM64_V8A + : Constants::ANDROID_ABI_ARMEABI_V7A); + else + androidAbi = QLatin1String(abi.wordWidth() == 64 ? Constants::ANDROID_ABI_X86_64 + : Constants::ANDROID_ABI_X86); + return androidAbi; +} + // -------------------------------------------------------------------------- // Abi // -------------------------------------------------------------------------- @@ -908,7 +921,11 @@ Abi Abi::fromString(const QString &abiString) return Abi(architecture, os, flavor, format, 0); } - return Abi(architecture, os, flavor, format, wordWidth); + Abi abi(architecture, os, flavor, format, wordWidth); + if (abi.os() == LinuxOS && abi.osFlavor() == AndroidLinuxFlavor) + abi.m_param = androidAbiFromAbi(abi); + + return abi; } Abi::Architecture Abi::architectureFromString(const QString &a)