PE: Fix handling of compiler command on Windows

Broke with c60c642fe5 and resulted in losing the
compiler command for Qbs and CMake for MSVC based tool
chains.

Change-Id: I400fda14869ebf11dc7ddc2fda7d5a52a2fc096a
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2020-11-25 08:44:28 +01:00
parent 3b93ade234
commit 02c876f6e8
2 changed files with 3 additions and 5 deletions

View File

@@ -1149,8 +1149,8 @@ void MsvcToolChain::rescanForCompiler()
Utils::Environment env = Utils::Environment::systemEnvironment();
addToEnvironment(env);
m_compilerCommand
= env.searchInPath(QLatin1String("cl.exe"), {}, [](const Utils::FilePath &name) {
setCompilerCommand(
env.searchInPath(QLatin1String("cl.exe"), {}, [](const Utils::FilePath &name) {
QDir dir(QDir::cleanPath(name.toFileInfo().absolutePath() + QStringLiteral("/..")));
do {
if (QFile::exists(dir.absoluteFilePath(QStringLiteral("vcvarsall.bat")))
@@ -1158,7 +1158,7 @@ void MsvcToolChain::rescanForCompiler()
return true;
} while (dir.cdUp() && !dir.isRoot());
return false;
});
}));
}
QList<OutputLineParser *> MsvcToolChain::createOutputParsers() const

View File

@@ -152,8 +152,6 @@ private:
mutable Utils::Environment m_lastEnvironment; // Last checked 'incoming' environment.
mutable Utils::Environment m_resultEnvironment; // Resulting environment for VC
Utils::FilePath m_compilerCommand;
protected:
QString m_vcvarsBat;
QString m_varsBatArg; // Argument