From 7fa70da1591368a4cab3f343e4667dbcb282a419 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 16 Jan 2024 17:38:48 +0100 Subject: [PATCH] PE: Set Android ABI to the Abi object instantiation 640a4f0c9cc3a7d31fed16b324a2a1faec0b5a7f introduced caching of qmake output, which includes the supported abis. Unfortunately the Abi::toString and Abi::fromString didn't serialize the m_param value which was used by the Android plugin to specify the Android ABI. This commit will generate the Android ABI from the existing values. Fixes: QTCREATORBUG-30146 Change-Id: I6770faa3953f7b423b36b9e3654a7e270d051571 Reviewed-by: Alessandro Portale Reviewed-by: Marcus Tillmanns --- src/plugins/projectexplorer/abi.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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)