aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/qbs-setup-toolchains/msvcprobe.cpp
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2018-05-24 12:18:53 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2018-05-24 10:54:21 +0000
commit49aec667b6f91b45a14b35cad42cb3b2dbcfbe33 (patch)
treea1f62b1dba94d4af8332a900562b78a9ff86d307 /src/app/qbs-setup-toolchains/msvcprobe.cpp
parent89beb7c66a1026c1161a87dfdefbc0b73928cc4b (diff)
qbs-setup-toolchains: Check for presence of cl.exe in MSVC bin paths
Now we check for the presence of cl.exe also for VS versions >= 15. This fixes warnings like: WARNING: Failed to set up MSVC2017-_1033: Could not start C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.14.26428/bin/arm/1033/cl.exe (Process failed to start: The system cannot find the file specified.) Change-Id: I2d8350abaa1b8a96a3e832d4bfc121f5fa2e52ba Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/app/qbs-setup-toolchains/msvcprobe.cpp')
-rw-r--r--src/app/qbs-setup-toolchains/msvcprobe.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/app/qbs-setup-toolchains/msvcprobe.cpp b/src/app/qbs-setup-toolchains/msvcprobe.cpp
index 294523c1c..919f88d12 100644
--- a/src/app/qbs-setup-toolchains/msvcprobe.cpp
+++ b/src/app/qbs-setup-toolchains/msvcprobe.cpp
@@ -103,6 +103,10 @@ struct MSVCArchInfo
static std::vector<MSVCArchInfo> findSupportedArchitectures(const MSVC &msvc)
{
std::vector<MSVCArchInfo> result;
+ auto addResult = [&result](const MSVCArchInfo &ai) {
+ if (QFile::exists(ai.binPath + QLatin1String("/cl.exe")))
+ result.push_back(ai);
+ };
if (msvc.internalVsVersion.majorVersion() < 15) {
static const QStringList knownArchitectures = QStringList()
<< QStringLiteral("x86")
@@ -117,8 +121,7 @@ static std::vector<MSVCArchInfo> findSupportedArchitectures(const MSVC &msvc)
MSVCArchInfo ai;
ai.arch = knownArchitecture;
ai.binPath = msvc.binPathForArchitecture(knownArchitecture);
- if (QFile::exists(ai.binPath + QLatin1String("/cl.exe")))
- result.push_back(ai);
+ addResult(ai);
}
} else {
QDir vcInstallDir(msvc.vcInstallPath);
@@ -136,7 +139,7 @@ static std::vector<MSVCArchInfo> findSupportedArchitectures(const MSVC &msvc)
ai.arch = arch;
else
ai.arch = shortHostArch + QLatin1Char('_') + arch;
- result.push_back(ai);
+ addResult(ai);
}
}
}