From 02d3e3d2911352aabbc285af564c4743a85e7e27 Mon Sep 17 00:00:00 2001 From: Oliver Wolff <oliver.wolff@nokia.com> Date: Fri, 6 Jan 2012 13:52:28 +0100 Subject: [PATCH] Moved detection of jom location to MingwToolChain As mingw and perhaps other toolchains using gnu makefiles might want to use jom as well, it should be possible to obtain jom's location from somewhere else. Change-Id: I25ac88b51c84a9d19e5e61a4caa53e1b1a5d5fb9 Reviewed-by: hjk <qthjk@ovi.com> --- .../projectexplorer/abstractmsvctoolchain.cpp | 11 ++--------- src/plugins/projectexplorer/gcctoolchain.cpp | 17 +++++++++++++++++ src/plugins/projectexplorer/gcctoolchain.h | 1 + 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/plugins/projectexplorer/abstractmsvctoolchain.cpp b/src/plugins/projectexplorer/abstractmsvctoolchain.cpp index cd86b0d1e85..fd062fd0012 100644 --- a/src/plugins/projectexplorer/abstractmsvctoolchain.cpp +++ b/src/plugins/projectexplorer/abstractmsvctoolchain.cpp @@ -36,6 +36,7 @@ #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorersettings.h> +#include <projectexplorer/gcctoolchain.h> #include <utils/fileutils.h> @@ -121,15 +122,7 @@ void AbstractMsvcToolChain::addToEnvironment(Utils::Environment &env) const QString AbstractMsvcToolChain::makeCommand() const { if (ProjectExplorerPlugin::instance()->projectExplorerSettings().useJom) { - // We want jom! Try to find it. - const QString jom = QLatin1String("jom.exe"); - const QFileInfo installedJom = QFileInfo(QCoreApplication::applicationDirPath() - + QLatin1Char('/') + jom); - if (installedJom.isFile() && installedJom.isExecutable()) { - return installedJom.absoluteFilePath(); - } else { - return jom; - } + return MingwToolChain::findInstalledJom(); } return QLatin1String("nmake.exe"); } diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index f374fd3e225..1a6787add1b 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -874,6 +874,23 @@ QString MingwToolChain::makeCommand() const return QLatin1String("mingw32-make.exe"); } +QString MingwToolChain::findInstalledJom() +{ + if (Abi::hostAbi().os() != Abi::WindowsOS) { + qWarning() << "Jom can only be used on Windows"; + return QString(); + } + + // We want jom! Try to find it. + const QString jom = QLatin1String("jom.exe"); + const QFileInfo installedJom = QFileInfo(QCoreApplication::applicationDirPath() + + QLatin1Char('/') + jom); + if (installedJom.isFile() && installedJom.isExecutable()) + return installedJom.absoluteFilePath(); + else + return jom; +} + ToolChain *MingwToolChain::clone() const { return new MingwToolChain(*this); diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 8ab8111e5c2..8aee14a93ad 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -145,6 +145,7 @@ public: QString typeName() const; Utils::FileName mkspec() const; QString makeCommand() const; + static QString findInstalledJom(); ToolChain *clone() const; -- GitLab