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(); Utils::Environment env = Utils::Environment::systemEnvironment();
addToEnvironment(env); addToEnvironment(env);
m_compilerCommand setCompilerCommand(
= env.searchInPath(QLatin1String("cl.exe"), {}, [](const Utils::FilePath &name) { env.searchInPath(QLatin1String("cl.exe"), {}, [](const Utils::FilePath &name) {
QDir dir(QDir::cleanPath(name.toFileInfo().absolutePath() + QStringLiteral("/.."))); QDir dir(QDir::cleanPath(name.toFileInfo().absolutePath() + QStringLiteral("/..")));
do { do {
if (QFile::exists(dir.absoluteFilePath(QStringLiteral("vcvarsall.bat"))) if (QFile::exists(dir.absoluteFilePath(QStringLiteral("vcvarsall.bat")))
@@ -1158,7 +1158,7 @@ void MsvcToolChain::rescanForCompiler()
return true; return true;
} while (dir.cdUp() && !dir.isRoot()); } while (dir.cdUp() && !dir.isRoot());
return false; return false;
}); }));
} }
QList<OutputLineParser *> MsvcToolChain::createOutputParsers() const 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_lastEnvironment; // Last checked 'incoming' environment.
mutable Utils::Environment m_resultEnvironment; // Resulting environment for VC mutable Utils::Environment m_resultEnvironment; // Resulting environment for VC
Utils::FilePath m_compilerCommand;
protected: protected:
QString m_vcvarsBat; QString m_vcvarsBat;
QString m_varsBatArg; // Argument QString m_varsBatArg; // Argument