summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/configure/environment.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp
index 1a05c9ce62..bf82f14159 100644
--- a/tools/configure/environment.cpp
+++ b/tools/configure/environment.cpp
@@ -154,12 +154,13 @@ QString Environment::msvcVersion()
const QString command = QFile::decodeName(qgetenv("ComSpec"))
+ QLatin1String(" /c ") + QLatin1String(compilerInfo(CC_MSVC2015)->executable)
+ QLatin1String(" /? 2>&1");
+ SetEnvironmentVariable(L"CL", NULL); // May contain /nologo, which suppresses the version.
QString version = execute(command, &returnValue);
if (returnValue != 0) {
cout << "Could not get cl version" << returnValue << qPrintable(version) << '\n';;
version.clear();
} else {
- QRegExp versionRegexp(QStringLiteral("^.*Compiler Version ([0-9.]+) for.*$"));
+ QRegExp versionRegexp(QStringLiteral("^.*\\b(\\d{2,2}\\.\\d{2,2}\\.\\d{5,5})\\b.*$"));
Q_ASSERT(versionRegexp.isValid());
if (versionRegexp.exactMatch(version)) {
version = versionRegexp.cap(1);