diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 78065d7dd7f..221998bf2bf 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -390,7 +390,7 @@ void AndroidBuildApkStep::doRun() QJsonObject deploySettings = Android::AndroidManager::deploymentSettings(target()); QString applicationBinary; - if (version->qtVersion() < QtSupport::QtVersionNumber(5, 14, 0)) { + if (!version->supportsMultipleQtAbis()) { QTC_ASSERT(androidAbis.size() == 1, return false); applicationBinary = buildSystem()->buildTarget(buildKey).targetFilePath.toString(); FilePath androidLibsDir = buildDirectory() / "android-build/libs" / androidAbis.first(); diff --git a/src/plugins/android/androidbuildapkwidget.cpp b/src/plugins/android/androidbuildapkwidget.cpp index 5396a3de3e5..e84dcaca18a 100644 --- a/src/plugins/android/androidbuildapkwidget.cpp +++ b/src/plugins/android/androidbuildapkwidget.cpp @@ -235,7 +235,7 @@ QWidget *AndroidBuildApkWidget::createAdvancedGroup() auto vbox = new QVBoxLayout(group); QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(step()->target()->kit()); - if (version && version->qtVersion() >= QtSupport::QtVersionNumber{5,14}) { + if (version && version->supportsMultipleQtAbis()) { auto buildAAB = new QCheckBox(tr("Build .aab (Android App Bundle)"), group); buildAAB->setChecked(m_step->buildAAB()); connect(buildAAB, &QAbstractButton::toggled, m_step, &AndroidBuildApkStep::setBuildAAB); diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index 8ce1298f8a2..fbf298c84be 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -287,7 +287,7 @@ QJsonObject AndroidManager::deploymentSettings(const Target *target) settings["qt"] = qt->prefix().toString(); settings["ndk"] = AndroidConfigurations::currentConfig().ndkLocation(qt).toString(); settings["sdk"] = AndroidConfigurations::currentConfig().sdkLocation().toString(); - if (qt->qtVersion() < QtSupport::QtVersionNumber(5, 14, 0)) { + if (!qt->supportsMultipleQtAbis()) { const QStringList abis = applicationAbis(target); QTC_ASSERT(abis.size() == 1, return {}); settings["stdcpp-path"] = (AndroidConfigurations::currentConfig().toolchainPath(qt) diff --git a/src/plugins/android/androidqtversion.cpp b/src/plugins/android/androidqtversion.cpp index 568df99429d..32a58ffc667 100644 --- a/src/plugins/android/androidqtversion.cpp +++ b/src/plugins/android/androidqtversion.cpp @@ -84,6 +84,11 @@ QString AndroidQtVersion::invalidReason() const return tmp; } +bool AndroidQtVersion::supportsMultipleQtAbis() const +{ + return qtVersion() >= QtSupport::QtVersionNumber{5, 14}; +} + Abis AndroidQtVersion::detectQtAbis() const { auto androidAbi2Abi = [](const QString &androidAbi) { @@ -165,7 +170,7 @@ int AndroidQtVersion::minimumNDK() const void AndroidQtVersion::parseMkSpec(ProFileEvaluator *evaluator) const { - if (qtVersion() >= QtSupport::QtVersionNumber{5, 14}) + if (supportsMultipleQtAbis()) m_androidAbis = evaluator->values("ALL_ANDROID_ABIS"); else m_androidAbis = QStringList{evaluator->value("ANDROID_TARGET_ARCH")}; diff --git a/src/plugins/android/androidqtversion.h b/src/plugins/android/androidqtversion.h index 2d00a798dbe..ab07b0464a8 100644 --- a/src/plugins/android/androidqtversion.h +++ b/src/plugins/android/androidqtversion.h @@ -43,6 +43,7 @@ public: bool isValid() const override; QString invalidReason() const override; + bool supportsMultipleQtAbis() const override; ProjectExplorer::Abis detectQtAbis() const override; void addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const override; diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 48507a56114..d99c98230fc 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -166,7 +166,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Utils::Id id) initialArgs.append(QString::fromLatin1("-DANDROID_ABI:STRING=%1").arg(preferredAbi)); QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(k); - if (qt && qt->qtVersion() >= QtSupport::QtVersionNumber{5, 14, 0}) { + if (qt && qt->supportsMultipleQtAbis()) { auto sdkLocation = bs->data(Android::Constants::SdkLocation).value(); initialArgs.append( QString::fromLatin1("-DANDROID_SDK:PATH=%1").arg(sdkLocation.toString())); diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp index ffc1942cc44..e298519316d 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp @@ -423,7 +423,7 @@ bool QmakeProFileNode::setData(Utils::Id role, const QVariant &value) const int flags = QmakeProjectManager::Internal::ProWriter::ReplaceValues; if (Target *target = m_buildSystem->target()) { QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(target->kit()); - if (version && version->qtVersion() < QtSupport::QtVersionNumber(5, 14, 0)) { + if (version && !version->supportsMultipleQtAbis()) { const QString arch = pro->singleVariableValue(Variable::AndroidArch); scope = "contains(ANDROID_TARGET_ARCH," + arch + ')'; flags |= QmakeProjectManager::Internal::ProWriter::MultiLine; diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index a04e7506d39..eea45248f9c 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -1692,6 +1692,11 @@ Tasks BaseQtVersion::reportIssuesImpl(const QString &proFile, const QString &bui return results; } +bool BaseQtVersion::supportsMultipleQtAbis() const +{ + return false; +} + Tasks BaseQtVersion::reportIssues(const QString &proFile, const QString &buildDir) const { Tasks results = reportIssuesImpl(proFile, buildDir); diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h index 436a6e03879..338dc328895 100644 --- a/src/plugins/qtsupport/baseqtversion.h +++ b/src/plugins/qtsupport/baseqtversion.h @@ -235,6 +235,8 @@ public: QSet features() const; + virtual bool supportsMultipleQtAbis() const; + protected: BaseQtVersion(); BaseQtVersion(const BaseQtVersion &other) = delete;