Skip to content

Commit

Permalink
Remove hard-coded MS compiler versions from the mkspecs
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
thiagomacieira authored and ossilator committed Dec 23, 2016
1 parent 5196d56 commit 4d9fbb3
Show file tree
Hide file tree
Showing 20 changed files with 22 additions and 44 deletions.
7 changes: 1 addition & 6 deletions mkspecs/common/msvc-desktop.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -105,7 +104,3 @@ QMAKE_RC = rc
VCPROJ_EXTENSION = .vcproj
VCSOLUTION_EXTENSION = .sln
VCPROJ_KEYWORD = Qt4VSv1.0

include(msvc-base.conf)

unset(MSC_VER)
26 changes: 20 additions & 6 deletions mkspecs/common/msvc-base.conf → mkspecs/common/msvc-version.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -24,31 +30,39 @@ 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
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings
}
}

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
}
4 changes: 0 additions & 4 deletions mkspecs/common/winrt_winphone/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion mkspecs/features/win32/default_pre.prf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CONFIG = rtti_off incremental_off windows $$CONFIG
load(default_pre)

msvc:!intel_icl:!clang_cl: include(../../common/msvc-version.conf)
2 changes: 0 additions & 2 deletions mkspecs/win32-clang-msvc2015/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
# Notice: this uses the clang-cl wrapper
#

MSC_VER = 1900
MSVC_VER = 14.0
include(../common/msvc-desktop.conf)

QMAKE_COMPILER += clang_cl llvm
Expand Down
2 changes: 0 additions & 2 deletions mkspecs/win32-msvc2005/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@
# Written for Microsoft Visual C++ 2005
#

MSC_VER = 1400
MSVC_VER = 8.0
include(../common/msvc-desktop.conf)
load(qt_config)
2 changes: 0 additions & 2 deletions mkspecs/win32-msvc2008/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@
# Written for Microsoft Visual C++ 2008
#

MSC_VER = 1500
MSVC_VER = 9.0
include(../common/msvc-desktop.conf)
load(qt_config)
2 changes: 0 additions & 2 deletions mkspecs/win32-msvc2010/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@
# Written for Microsoft Visual C++ 2010
#

MSC_VER = 1600
MSVC_VER = 10.0
include(../common/msvc-desktop.conf)
load(qt_config)
2 changes: 0 additions & 2 deletions mkspecs/win32-msvc2012/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@
# Written for Microsoft Visual C++ 2012
#

MSC_VER = 1700
MSVC_VER = 11.0
include(../common/msvc-desktop.conf)
load(qt_config)
2 changes: 0 additions & 2 deletions mkspecs/win32-msvc2013/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@
# Written for Microsoft Visual C++ 2013
#

MSC_VER = 1800
MSVC_VER = 12.0
include(../common/msvc-desktop.conf)
load(qt_config)
2 changes: 0 additions & 2 deletions mkspecs/win32-msvc2015/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@
# Written for Microsoft Visual C++ 2015
#

MSC_VER = 1900
MSVC_VER = 14.0
include(../common/msvc-desktop.conf)
load(qt_config)
2 changes: 0 additions & 2 deletions mkspecs/win32-msvc2017/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@
# Written for Microsoft Visual C++ 2017
#

MSC_VER = 1910
MSVC_VER = 15.0
include(../common/msvc-desktop.conf)
load(qt_config)
1 change: 0 additions & 1 deletion mkspecs/winphone-arm-msvc2013/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ QMAKE_LFLAGS += /MACHINE:ARM /NODEFAULTLIB:kernel32.lib
QMAKE_LIBS += WindowsPhoneCore.lib PhoneAppModelHost.lib

VCPROJ_ARCH = ARM
MSVC_VER = 12.0
WINSDK_VER = 8.1
WINTARGET_VER = WP81
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/8.1_wp/AppxManifest.xml.in
Expand Down
1 change: 0 additions & 1 deletion mkspecs/winphone-x86-msvc2013/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ QMAKE_LFLAGS += /MACHINE:X86 /NODEFAULTLIB:kernel32.lib
QMAKE_LIBS += WindowsPhoneCore.lib PhoneAppModelHost.lib

VCPROJ_ARCH = Win32
MSVC_VER = 12.0
WINSDK_VER = 8.1
WINTARGET_VER = WP81
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/8.1_wp/AppxManifest.xml.in
Expand Down
1 change: 0 additions & 1 deletion mkspecs/winrt-arm-msvc2013/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ QMAKE_LFLAGS += /MACHINE:ARM
QMAKE_LIBS += windowscodecs.lib kernel32.lib ole32.lib

VCPROJ_ARCH = ARM
MSVC_VER = 12.0
WINSDK_VER = 8.1
WINTARGET_VER = winv6.3
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/8.1/AppxManifest.xml.in
Expand Down
2 changes: 0 additions & 2 deletions mkspecs/winrt-arm-msvc2015/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# Written for Microsoft Visual C++ 2015
#

MSC_VER = 1900
include(../common/winrt_winphone/qmake.conf)
DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 ARM __ARM__ __arm__

Expand All @@ -15,7 +14,6 @@ QMAKE_LFLAGS += /MACHINE:ARM /NODEFAULTLIB:kernel32.lib
QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib

VCPROJ_ARCH = ARM
MSVC_VER = 14.0
WINSDK_VER = 10.0
WINTARGET_VER = winv10.0
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
Expand Down
1 change: 0 additions & 1 deletion mkspecs/winrt-x64-msvc2013/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ QMAKE_LFLAGS += /MACHINE:X64
QMAKE_LIBS += windowscodecs.lib kernel32.lib ole32.lib

VCPROJ_ARCH = x64
MSVC_VER = 12.0
WINSDK_VER = 8.1
WINTARGET_VER = winv6.3
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/8.1/AppxManifest.xml.in
Expand Down
2 changes: 0 additions & 2 deletions mkspecs/winrt-x64-msvc2015/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# Written for Microsoft Visual C++ 2015
#

MSC_VER = 1900
include(../common/winrt_winphone/qmake.conf)
QMAKE_COMPILER_DEFINES += _WIN32
DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X64 __X64__ __x64__
Expand All @@ -16,7 +15,6 @@ QMAKE_LFLAGS += /MACHINE:X64 /NODEFAULTLIB:kernel32.lib
QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib

VCPROJ_ARCH = x64
MSVC_VER = 14.0
WINSDK_VER = 10.0
WINTARGET_VER = winv10.0
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
Expand Down
1 change: 0 additions & 1 deletion mkspecs/winrt-x86-msvc2013/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ QMAKE_LFLAGS += /SAFESEH /MACHINE:X86
QMAKE_LIBS += windowscodecs.lib kernel32.lib ole32.lib

VCPROJ_ARCH = Win32
MSVC_VER = 12.0
WINSDK_VER = 8.1
WINTARGET_VER = winv6.3
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/8.1/AppxManifest.xml.in
Expand Down
2 changes: 0 additions & 2 deletions mkspecs/winrt-x86-msvc2015/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# Written for Microsoft Visual C++ 2015
#

MSC_VER = 1900
include(../common/winrt_winphone/qmake.conf)
QMAKE_COMPILER_DEFINES += _WIN32
DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X86 __X86__ __x86__
Expand All @@ -15,7 +14,6 @@ QMAKE_LFLAGS += /SAFESEH /MACHINE:X86 /NODEFAULTLIB:kernel32.lib

QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
VCPROJ_ARCH = Win32
MSVC_VER = 14.0
WINSDK_VER = 10.0
WINTARGET_VER = winv10.0
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
Expand Down

0 comments on commit 4d9fbb3

Please sign in to comment.