diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2019-12-06 17:58:38 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2019-12-06 20:08:13 +0000 |
commit | 9eed77fe86ed91b08d4f9dc23d3534eeb3dfff6a (patch) | |
tree | 50b1465c79be87d589f420a15575882aa64b87ca | |
parent | a44562f6766a46446c4870068122039eed928d84 (diff) | |
download | qt-creator-9eed77fe86ed91b08d4f9dc23d3534eeb3dfff6a.tar.gz |
McuSupport: Set jom via CMAKE_MAKE_PROGRAM instead of adding it to Path
Let's add less to the Path variable of the Kit's build environment. If
jom.exe is present, define it via CMAKE_MAKE_PROGRAM, set the CMake
Generator to Jom and hide the CMake Generator setting.
Change-Id: I58de73dc631f753d3e5c1706e593afb923fcb588
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
-rw-r--r-- | src/plugins/mcusupport/mcusupportoptions.cpp | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/plugins/mcusupport/mcusupportoptions.cpp b/src/plugins/mcusupport/mcusupportoptions.cpp index 4132259d4a..0d00c45dd3 100644 --- a/src/plugins/mcusupport/mcusupportoptions.cpp +++ b/src/plugins/mcusupport/mcusupportoptions.cpp @@ -487,6 +487,13 @@ static bool mcuTargetIsDesktop(const McuTarget* mcuTarget) return mcuTarget->qulPlatform() == "Qt"; } +static Utils::FilePath jomExecutablePath() +{ + return Utils::HostOsInfo::isWindowsHost() ? + Utils::FilePath::fromUserInput(Core::ICore::libexecPath() + "/jom.exe") + : Utils::FilePath(); +} + static void setKitProperties(const QString &kitName, ProjectExplorer::Kit *k, const McuTarget* mcuTarget) { @@ -500,9 +507,13 @@ static void setKitProperties(const QString &kitName, ProjectExplorer::Kit *k, if (mcuTargetIsDesktop(mcuTarget)) { k->setDeviceTypeForIcon(Constants::DEVICE_TYPE); } else { - k->setIrrelevantAspects({SysRootKitAspect::id(), - "QtSupport.QtInformation" // QtKitAspect::id() - }); + QSet<Core::Id> irrelevant = { + SysRootKitAspect::id(), + "QtSupport.QtInformation" // QtKitAspect::id() + }; + if (jomExecutablePath().exists()) // TODO: add id() getter to CMakeGeneratorKitAspect + irrelevant.insert("CMake.GeneratorKitInformation"); + k->setIrrelevantAspects(irrelevant); } } @@ -564,8 +575,6 @@ static void setKitEnvironment(ProjectExplorer::Kit *k, const McuTarget* mcuTarge QDir::toNativeSeparators(package->path())}); } pathAdditions.append("${Path}"); - if (Utils::HostOsInfo::isWindowsHost()) - pathAdditions.append(QDir::toNativeSeparators(Core::ICore::libexecPath())); // for jom pathAdditions.append(QDir::toNativeSeparators(Core::ICore::libexecPath() + "/clang/bin")); const QString path = QLatin1String(Utils::HostOsInfo().isWindowsHost() ? "Path" : "PATH"); changes.append({path, pathAdditions.join(Utils::HostOsInfo::pathListSeparator())}); @@ -591,9 +600,12 @@ static void setKitCMakeOptions(ProjectExplorer::Kit *k, const McuTarget* mcuTarg if (mcuTarget->colorDepth() >= 0) config.append(CMakeConfigItem("QUL_COLOR_DEPTH", QString::number(mcuTarget->colorDepth()).toLatin1())); - CMakeConfigurationKitAspect::setConfiguration(k, config); - if (Utils::HostOsInfo::isWindowsHost()) + const Utils::FilePath jom = jomExecutablePath(); + if (jom.exists()) { + config.append(CMakeConfigItem("CMAKE_MAKE_PROGRAM", jom.toString().toLatin1())); CMakeGeneratorKitAspect::setGenerator(k, "NMake Makefiles JOM"); + } + CMakeConfigurationKitAspect::setConfiguration(k, config); } QString McuSupportOptions::kitName(const McuTarget *mcuTarget) const |