Commit 8481c91f authored by BogDan Vatra's avatar BogDan Vatra Committed by Daniel Teske

Android: Set ANDROID_NDK_PLATFORM based on the mimum sdk version

And not based on the build sdk version.

Change-Id: I31a37652d40408e7bfc3f49366d97f560ee99c71
Reviewed-by: default avatarBogDan Vatra <bogdan@kde.org>
parent 384d5d75
......@@ -836,11 +836,10 @@ SdkPlatform AndroidConfig::highestAndroidSdk() const
return m_availableSdkPlatforms.first();
}
QString AndroidConfig::bestNdkPlatformMatch(const QString &targetAPI) const
QString AndroidConfig::bestNdkPlatformMatch(int target) const
{
updateNdkInformation();
int target = targetAPI.mid(targetAPI.lastIndexOf(QLatin1Char('-')) + 1).toInt();
target = std::max(9, target);
updateNdkInformation();
foreach (int apiLevel, m_availableNdkPlatforms) {
if (apiLevel <= target)
return QString::fromLatin1("android-%1").arg(apiLevel);
......
......@@ -147,7 +147,7 @@ public:
bool startAVDAsync(const QString &avdName) const;
QString findAvd(int apiLevel, const QString &cpuAbi) const;
QString waitForAvd(int apiLevel, const QString &cpuAbi, const QFutureInterface<bool> &fi = QFutureInterface<bool>()) const;
QString bestNdkPlatformMatch(const QString &targetAPI) const;
QString bestNdkPlatformMatch(int target) const;
static ProjectExplorer::Abi::Architecture architectureForToolChainPrefix(const QString &toolchainprefix);
static QLatin1String toolchainPrefix(ProjectExplorer::Abi::Architecture architecture);
......
......@@ -122,7 +122,7 @@ void AndroidQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::En
return;
env.set(QLatin1String("ANDROID_NDK_PLATFORM"),
AndroidConfigurations::currentConfig().bestNdkPlatformMatch(AndroidManager::buildTargetSDK(target)));
AndroidConfigurations::currentConfig().bestNdkPlatformMatch(AndroidManager::minimumSDK(target)));
}
Utils::Environment AndroidQtVersion::qmakeRunEnvironment() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment