diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2016-11-16 14:18:42 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2016-12-23 13:45:26 +0000 |
commit | 4d9fbb33458c82aaf37d9712495a0653aae70533 (patch) | |
tree | e4c5bb186ccf8b05185ae96a444b7667bb8209d5 /mkspecs/common/msvc-version.conf | |
parent | 5196d5602c70b8d4c08e49921e9459425ada8a42 (diff) |
Remove hard-coded MS compiler versions from the mkspecs
We're asking the compiler anyway, so we can fully use this information
just as well. Note that this actually happens after the spec itself has
been processed, so it was necessary to delay the version-specific flag
handling as well.
Change-Id: Ib57b52598e2f452985e9fffd14587b581d946022
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'mkspecs/common/msvc-version.conf')
-rw-r--r-- | mkspecs/common/msvc-version.conf | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/mkspecs/common/msvc-version.conf b/mkspecs/common/msvc-version.conf new file mode 100644 index 0000000000..8158ee37ab --- /dev/null +++ b/mkspecs/common/msvc-version.conf @@ -0,0 +1,68 @@ +# +# qmake configuration for Microsoft Visual Studio C/C++ Compiler +# This mkspec is used for all win32-msvcXXXX, winrt-XXX-msvcXXX +# and winphone-XXX-msvcXXX specs +# + +# +# Version-specific changes +# + +isEmpty(QMAKE_MSC_VER): error("msvc-version.conf loaded but QMAKE_MSC_VER isn't set") + +MSVC_VER = 8.0 + +greaterThan(QMAKE_MSC_VER, 1499) { + # Visual Studio 2008 (9.0) / Visual C++ 15.0 and up + MSVC_VER = 9.0 + QMAKE_CFLAGS_MP = -MP + QMAKE_CXXFLAGS_MP = $$QMAKE_CFLAGS_MP +} + +greaterThan(QMAKE_MSC_VER, 1599) { + # Visual Studio 2010 (10.0) / Visual C++ 16.0 and up + MSVC_VER = 10.0 + MAKEFILE_GENERATOR = MSBUILD + + QMAKE_CFLAGS_AVX = -arch:AVX + QMAKE_CFLAGS_AVX2 = -arch:AVX + + VCPROJ_EXTENSION = .vcxproj +} + +greaterThan(QMAKE_MSC_VER, 1699) { + # Visual Studio 2012 (11.0) / Visual C++ 17.0 and up + MSVC_VER = 11.0 + QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -D_HAS_EXCEPTIONS=0 + QT_CONFIG += c++11 + CONFIG += c++11 +} + +greaterThan(QMAKE_MSC_VER, 1799) { + # Visual Studio 2013 (12.0) / Visual C++ 18.0 and up + MSVC_VER = 12.0 + QMAKE_CFLAGS += -FS + QMAKE_CXXFLAGS += -FS + + equals(QMAKE_MSC_VER, 1800) { + QMAKE_CFLAGS_RELEASE += -Zc:strictStrings + QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings + QMAKE_CXXFLAGS_RELEASE += -Zc:strictStrings + QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings + } +} + +greaterThan(QMAKE_MSC_VER, 1899) { + # Visual Studio 2015 (14.0) / Visual C++ 19.0 and up + MSVC_VER = 14.0 + QMAKE_CFLAGS += -Zc:strictStrings + QMAKE_CFLAGS_WARN_ON += -w44456 -w44457 -w44458 + QMAKE_CFLAGS_AVX2 = -arch:AVX2 + QMAKE_CXXFLAGS += -Zc:strictStrings -Zc:throwingNew + QMAKE_CXXFLAGS_WARN_ON += -w44456 -w44457 -w44458 -wd4577 -wd4467 +} + +greaterThan(QMAKE_MSC_VER, 1909) { + # Visual Studio 2017 (15.0) / Visual C++ 19.10 and up + MSVC_VER = 15.0 +} |