Commit b6257ef7 authored by Daniel Teske's avatar Daniel Teske Committed by Eike Ziller
Browse files

AndroidQtVersion: Make environment hack safer



We need to set ANDROID_NDK_PLATFORM in the environment, but doing so is
not really possible on a per project basis. Make the hack in
AndroidQtVersion that sets ANDROID_NDK_PLATFORM safer by checking if the
current project's active target is indeed using a android kit.

Change-Id: Ifcdb07a19708ac6bac5f5a02caa1ff197c0e4d80
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@digia.com>
parent fba08f25
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <qtsupport/qtsupportconstants.h> #include <qtsupport/qtsupportconstants.h>
#include <qtsupport/qtversionmanager.h> #include <qtsupport/qtversionmanager.h>
#include <projectexplorer/target.h>
#include <projectexplorer/kit.h> #include <projectexplorer/kit.h>
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>
...@@ -115,8 +116,18 @@ void AndroidQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::En ...@@ -115,8 +116,18 @@ void AndroidQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::En
if (!qt4pro || !qt4pro->activeTarget() if (!qt4pro || !qt4pro->activeTarget()
|| QtSupport::QtKitInformation::qtVersion(k)->type() != QLatin1String(Constants::ANDROIDQT)) || QtSupport::QtKitInformation::qtVersion(k)->type() != QLatin1String(Constants::ANDROIDQT))
return; return;
Target *target = qt4pro->activeTarget();
if (DeviceTypeKitInformation::deviceTypeId(target->kit()) != Constants::ANDROID_DEVICE_TYPE)
return;
if (AndroidConfigurations::instance().config().ndkLocation.isEmpty()
|| AndroidConfigurations::instance().config().sdkLocation.isEmpty())
return;
if (AndroidConfigurations::instance().sdkTargets().isEmpty())
return;
env.set(QLatin1String("ANDROID_NDK_PLATFORM"), env.set(QLatin1String("ANDROID_NDK_PLATFORM"),
AndroidConfigurations::instance().bestMatch(AndroidManager::targetSDK(qt4pro->activeTarget()))); AndroidConfigurations::instance().bestMatch(AndroidManager::targetSDK(target)));
} }
......
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