Commit 889740a9 authored by Daniel Teske's avatar Daniel Teske

Android: Extra search directory to find make on windows

The sdk should set that extra directory, via the sdktool.

E. g. something like
sdktool addKeys android MakeExtraSearchDirectory QString:%DIRECTORY%

where %DIRECTORY% is the bin directory of the bundled mingw.
That is Tools\MinGW\bin for the qt sdk.

Also see:
Task-number: QTCREATORBUG-9297

Change-Id: I487c67b7fb704dd00cf5c6f4f647c8c4fbe8cd3d
Reviewed-by: default avatarRay Donnelly <mingw.android@gmail.com>
Reviewed-by: default avatarIikka Eklund <iikka.eklund@digia.com>
Reviewed-by: default avatarEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: default avatarTim Jenssen <tim.jenssen@digia.com>
parent 4bb73ada
......@@ -81,6 +81,7 @@ namespace {
const QLatin1String OpenJDKLocationKey("OpenJDKLocation");
const QLatin1String KeystoreLocationKey("KeystoreLocation");
const QLatin1String AutomaticKitCreationKey("AutomatiKitCreation");
const QLatin1String MakeExtraSearchDirectory("MakeExtraSearchDirectory");
const QLatin1String PartitionSizeKey("PartitionSize");
const QLatin1String ToolchainHostKey("ToolchainHost");
const QLatin1String ArmToolchainPrefix("arm-linux-androideabi");
......@@ -156,6 +157,11 @@ AndroidConfig::AndroidConfig(const QSettings &settings)
keystoreLocation = FileName::fromString(settings.value(KeystoreLocationKey).toString());
toolchainHost = settings.value(ToolchainHostKey).toString();
automaticKitCreation = settings.value(AutomaticKitCreationKey, true).toBool();
QString extraDirectory = settings.value(MakeExtraSearchDirectory).toString();
if (extraDirectory.isEmpty())
makeExtraSearchDirectories = QStringList();
else
makeExtraSearchDirectories << extraDirectory;
PersistentSettingsReader reader;
if (reader.load(FileName::fromString(sdkSettingsFileName()))
......@@ -170,6 +176,11 @@ AndroidConfig::AndroidConfig(const QSettings &settings)
QVariant v = reader.restoreValue(AutomaticKitCreationKey);
if (v.isValid())
automaticKitCreation = v.toBool();
QString extraDirectory = reader.restoreValue(MakeExtraSearchDirectory).toString();
if (extraDirectory.isEmpty())
makeExtraSearchDirectories = QStringList();
else
makeExtraSearchDirectories << extraDirectory;
// persistent settings
}
......@@ -599,6 +610,11 @@ QString AndroidConfigurations::bestMatch(const QString &targetAPI) const
return QLatin1String("android-8");
}
QStringList AndroidConfigurations::makeExtraSearchDirectories() const
{
return m_config.makeExtraSearchDirectories;
}
bool equalKits(Kit *a, Kit *b)
{
return ToolChainKitInformation::toolChain(a) == ToolChainKitInformation::toolChain(b)
......
......@@ -32,6 +32,7 @@
#include <QObject>
#include <QString>
#include <QStringList>
#include <QVector>
#include <projectexplorer/abi.h>
......@@ -55,6 +56,7 @@ public:
Utils::FileName openJDKLocation;
Utils::FileName keystoreLocation;
QString toolchainHost;
QStringList makeExtraSearchDirectories;
unsigned partitionSize;
bool automaticKitCreation;
};
......@@ -97,6 +99,8 @@ public:
QString startAVD(int *apiLevel, const QString &name = QString()) const;
QString bestMatch(const QString &targetAPI) const;
QStringList makeExtraSearchDirectories() const;
static ProjectExplorer::Abi::Architecture architectureForToolChainPrefix(const QString &toolchainprefix);
static QLatin1String toolchainPrefix(ProjectExplorer::Abi::Architecture architecture);
static QLatin1String toolsPrefix(ProjectExplorer::Abi::Architecture architecture);
......
......@@ -204,7 +204,7 @@ QString AndroidToolChain::makeCommand(const Utils::Environment &env) const
{
QString make = HostOsInfo::isWindowsHost()
? QLatin1String("ma-make.exe") : QLatin1String("make");
QString tmp = env.searchInPath(make);
QString tmp = env.searchInPath(make, AndroidConfigurations::instance().makeExtraSearchDirectories());
return tmp.isEmpty() ? make : tmp;
}
......
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