From b884fc00f4cb4b1ebe307374433b90448d413cf4 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 10 Oct 2016 13:57:33 +0200 Subject: configure.exe: Detect MSVC version with environment variable CL cleared The variable may contain the option /nologo, suppressing the output. Change-Id: I63eedde10aa7264cf56807a0844cadf6293a1d8c Task-number: QTBUG-56388 Reviewed-by: Laszlo Agocs Reviewed-by: Oswald Buddenhagen --- tools/configure/environment.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/configure') diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp index 10cf5ace2a..562c5db7a7 100644 --- a/tools/configure/environment.cpp +++ b/tools/configure/environment.cpp @@ -176,6 +176,7 @@ 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';; -- cgit v1.2.3