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 | |
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')
-rw-r--r-- | mkspecs/common/msvc-desktop.conf | 7 | ||||
-rw-r--r-- | mkspecs/common/msvc-version.conf (renamed from mkspecs/common/msvc-base.conf) | 26 | ||||
-rw-r--r-- | mkspecs/common/winrt_winphone/qmake.conf | 4 |
3 files changed, 21 insertions, 16 deletions
diff --git a/mkspecs/common/msvc-desktop.conf b/mkspecs/common/msvc-desktop.conf index ebe804db64..604321551b 100644 --- a/mkspecs/common/msvc-desktop.conf +++ b/mkspecs/common/msvc-desktop.conf @@ -3,10 +3,9 @@ # This mkspec is used for all win32-msvcXXXX specs # -isEmpty(MSC_VER)|isEmpty(MSVC_VER): error("Source mkspec must set both MSC_VER and MSVC_VER.") - # # Baseline: Visual Studio 2005 (8.0), VC++ 14.0 +# Version-specific settings go in msvc-version.conf (loaded by default_pre) # include(angle.conf) @@ -105,7 +104,3 @@ QMAKE_RC = rc VCPROJ_EXTENSION = .vcproj VCSOLUTION_EXTENSION = .sln VCPROJ_KEYWORD = Qt4VSv1.0 - -include(msvc-base.conf) - -unset(MSC_VER) diff --git a/mkspecs/common/msvc-base.conf b/mkspecs/common/msvc-version.conf index d54b11507e..8158ee37ab 100644 --- a/mkspecs/common/msvc-base.conf +++ b/mkspecs/common/msvc-version.conf @@ -8,14 +8,20 @@ # Version-specific changes # -greaterThan(MSC_VER, 1499) { +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(MSC_VER, 1599) { +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 @@ -24,19 +30,21 @@ greaterThan(MSC_VER, 1599) { VCPROJ_EXTENSION = .vcxproj } -greaterThan(MSC_VER, 1699) { +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(MSC_VER, 1799) { +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(MSC_VER, 1800) { + equals(QMAKE_MSC_VER, 1800) { QMAKE_CFLAGS_RELEASE += -Zc:strictStrings QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings QMAKE_CXXFLAGS_RELEASE += -Zc:strictStrings @@ -44,11 +52,17 @@ greaterThan(MSC_VER, 1799) { } } -greaterThan(MSC_VER, 1899) { +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 +} diff --git a/mkspecs/common/winrt_winphone/qmake.conf b/mkspecs/common/winrt_winphone/qmake.conf index 05c9bd39a5..27269176d0 100644 --- a/mkspecs/common/winrt_winphone/qmake.conf +++ b/mkspecs/common/winrt_winphone/qmake.conf @@ -97,8 +97,4 @@ WINRT_ASSETS_PATH = $$PWD/assets WINRT_MANIFEST.capabilities = defaults WINRT_MANIFEST.capabilities_device = defaults -include(../msvc-base.conf) - -unset(MSC_VER) - load(qt_config) |