forked from qt-creator/qt-creator
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: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
This commit is contained in:
committed by
Eike Ziller
parent
fba08f2552
commit
b6257ef735
@@ -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
|
|||||||
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)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user