From 5971b88ecd08a81720c3556029cecd35b0cf2cb5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 1 Sep 2016 10:48:06 +0200 Subject: configure.exe: Write MSVC compiler version to qconfig.pri Backport a feature of the new configure system setting the variables QT_CL_MAJOR_VERSION, QT_CL_MINOR_VERSION, QT_CL_PATCH_VERSION similarly to the existing variables for gcc. This allows for disabling optimizations depending on the compiler version. Task-number: QTBUG-55238 Change-Id: If2349b008c1049e2ab98a5c1160b244a6e8937a8 Reviewed-by: Oswald Buddenhagen --- tools/configure/configureapp.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tools/configure/configureapp.cpp') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index f2b54f57f2..88dcd8170b 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -314,6 +314,12 @@ Configure::Configure(int& argc, char** argv) : verbose(0) dictionary["QT_GCC_MAJOR_VERSION"] = parts.value(0, zero); dictionary["QT_GCC_MINOR_VERSION"] = parts.value(1, zero); dictionary["QT_GCC_PATCH_VERSION"] = parts.value(2, zero); + } else if (dictionary["QMAKESPEC"].contains(QString("msvc"))) { + const QString zero = QStringLiteral("0"); + const QStringList parts = Environment::msvcVersion().split(QLatin1Char('.')); + dictionary["QT_CL_MAJOR_VERSION"] = parts.value(0, zero); + dictionary["QT_CL_MINOR_VERSION"] = parts.value(1, zero); + dictionary["QT_CL_PATCH_VERSION"] = parts.value(2, zero); } } @@ -3629,6 +3635,10 @@ void Configure::generateQConfigPri() configStream << "QT_GCC_MAJOR_VERSION = " << dictionary["QT_GCC_MAJOR_VERSION"] << endl << "QT_GCC_MINOR_VERSION = " << dictionary["QT_GCC_MINOR_VERSION"] << endl << "QT_GCC_PATCH_VERSION = " << dictionary["QT_GCC_PATCH_VERSION"] << endl; + } else if (!dictionary["QT_CL_MAJOR_VERSION"].isEmpty()) { + configStream << "QT_CL_MAJOR_VERSION = " << dictionary["QT_CL_MAJOR_VERSION"] << endl + << "QT_CL_MINOR_VERSION = " << dictionary["QT_CL_MINOR_VERSION"] << endl + << "QT_CL_PATCH_VERSION = " << dictionary["QT_CL_PATCH_VERSION"] << endl; } if (dictionary.value("XQMAKESPEC").startsWith("wince")) { -- cgit v1.2.3