From 86f0d72b2aa2c9e55a3439cbac5dd02dd73e6122 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 23 Apr 2021 11:59:23 +0200 Subject: [PATCH] Look for jom also in "jom" subdirectory Jom is currently installed into the Qt Creator bin/ directory directly, but it can be considered unsafe if we add that to the PATH. Look in a subdirectory for it as well, as preparation for moving it there instead. Task-number: QTCREATORBUG-25585 Change-Id: I85b379fa093c57639875872868c16b5cc964f4aa Reviewed-by: Cristian Adam Reviewed-by: Qt CI Bot --- src/plugins/cmakeprojectmanager/cmakekitinformation.cpp | 5 ++++- src/plugins/projectexplorer/msvctoolchain.cpp | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index 97557384eb3..d196511a04e 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -33,6 +33,8 @@ #include +#include + #include #include @@ -833,7 +835,8 @@ void CMakeGeneratorKitAspect::addToEnvironment(const Kit *k, Utils::Environment if (info.generator == "NMake Makefiles JOM") { if (env.searchInPath("jom.exe").exists()) return; - env.appendOrSetPath(QCoreApplication::applicationDirPath()); + env.appendOrSetPath(Core::ICore::libexecPath().toUserOutput()); + env.appendOrSetPath(Core::ICore::libexecPath().pathAppended("jom").toUserOutput()); } } diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 8e70a2330c4..9e5b4abc9ec 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -1111,8 +1111,8 @@ FilePath MsvcToolChain::makeCommand(const Environment &environment) const FilePath command; if (useJom) { tmp = environment.searchInPath(jom, - {Utils::FilePath::fromString( - QCoreApplication::applicationDirPath())}); + {Core::ICore::libexecPath(), + Core::ICore::libexecPath().pathAppended("jom")}); if (!tmp.isEmpty()) command = tmp; }