Match MSVC version strings in other languages than English

5971b88ecd introduced a regular expression
to parse the Visual C++ compiler version that failed to match non-English
output (e.g. German), which is produced by default on many systems.

Task-number: QTBUG-56388
Change-Id: Id0408ce31e827e7aa087d8e3dd83024cf09dac23
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Michael Brüning 2016-10-05 16:34:38 +02:00 committed by Oswald Buddenhagen
parent 3189313f22
commit 6851cf52af

View File

@ -182,7 +182,7 @@ QString Environment::msvcVersion()
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);