Skip to content

Commit

Permalink
Merge all "win32-msvc*" mkspecs into one
Browse files Browse the repository at this point in the history
Since we can tell the MSVC version from the compiler now, each of the
qmake.conf files is now the same, so let's just have "win32-msvc" and be
future-proof. Likewise for win32-clang-msvc.

qplatformdefs.h was already common.

Since we can't obtain the MSVC version from the unified mkspec name any
more, I dropped the warning level during the qmake bootstrap to reduce
the number of warnings that need to be disabled from compiler version to
version.

There is no point in keeping the old mkspecs, but configure will re-map
the -platform argument to the unified spec as necessary, to keep
existing configure command lines working.

[ChangeLog][Visual Studio] Qt now has a common mkspec for all Visual
Studio versions, called "win32-msvc". The old names which contained the
version number are now gone (but qmake scopes based on the old names
continue to work). The version of the compiler can be obtained from the
MSC_VER and MSVC_VER variables (for example, for Visual Studio 2015,
those contain the values 1900 and 14.0, respectively). Those variables
are also available with the Intel compiler (win32-icc) and with Clang
(win32-clang-msvc).

Done-with: Oswald Buddenhagen <[email protected]>
Change-Id: Ib57b52598e2f452985e9fffd14587c0a77a5c09c
Reviewed-by: Thiago Macieira <[email protected]>
Reviewed-by: Oswald Buddenhagen <[email protected]>
  • Loading branch information
thiagomacieira authored and ossilator committed Dec 23, 2016
1 parent 4d9fbb3 commit 04403d5
Show file tree
Hide file tree
Showing 27 changed files with 62 additions and 405 deletions.
2 changes: 1 addition & 1 deletion mkspecs/common/msvc-desktop.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# qmake configuration for Microsoft Visual Studio C/C++ Compiler
# This mkspec is used for all win32-msvcXXXX specs
# This mkspec is used by the win32-msvc and win32-clang-msvc specs
#

#
Expand Down
18 changes: 16 additions & 2 deletions mkspecs/common/msvc-version.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# 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
# This file is used by win32-msvc, win32-clang-msvc, and all
# winphone-XXX-msvcXXXX specs
#

#
Expand All @@ -11,17 +11,20 @@
isEmpty(QMAKE_MSC_VER): error("msvc-version.conf loaded but QMAKE_MSC_VER isn't set")

MSVC_VER = 8.0
COMPAT_MKSPEC = win32-msvc2005

greaterThan(QMAKE_MSC_VER, 1499) {
# Visual Studio 2008 (9.0) / Visual C++ 15.0 and up
MSVC_VER = 9.0
COMPAT_MKSPEC = win32-msvc2008
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
COMPAT_MKSPEC = win32-msvc2010
MAKEFILE_GENERATOR = MSBUILD

QMAKE_CFLAGS_AVX = -arch:AVX
Expand All @@ -33,6 +36,7 @@ greaterThan(QMAKE_MSC_VER, 1599) {
greaterThan(QMAKE_MSC_VER, 1699) {
# Visual Studio 2012 (11.0) / Visual C++ 17.0 and up
MSVC_VER = 11.0
COMPAT_MKSPEC = win32-msvc2012
QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -D_HAS_EXCEPTIONS=0
QT_CONFIG += c++11
CONFIG += c++11
Expand All @@ -41,6 +45,7 @@ greaterThan(QMAKE_MSC_VER, 1699) {
greaterThan(QMAKE_MSC_VER, 1799) {
# Visual Studio 2013 (12.0) / Visual C++ 18.0 and up
MSVC_VER = 12.0
COMPAT_MKSPEC = win32-msvc2013
QMAKE_CFLAGS += -FS
QMAKE_CXXFLAGS += -FS

Expand All @@ -55,6 +60,7 @@ greaterThan(QMAKE_MSC_VER, 1799) {
greaterThan(QMAKE_MSC_VER, 1899) {
# Visual Studio 2015 (14.0) / Visual C++ 19.0 and up
MSVC_VER = 14.0
COMPAT_MKSPEC = win32-msvc2015
QMAKE_CFLAGS += -Zc:strictStrings
QMAKE_CFLAGS_WARN_ON += -w44456 -w44457 -w44458
QMAKE_CFLAGS_AVX2 = -arch:AVX2
Expand All @@ -65,4 +71,12 @@ greaterThan(QMAKE_MSC_VER, 1899) {
greaterThan(QMAKE_MSC_VER, 1909) {
# Visual Studio 2017 (15.0) / Visual C++ 19.10 and up
MSVC_VER = 15.0
COMPAT_MKSPEC = win32-msvc2017
}

greaterThan(QMAKE_MSC_VER, 1910) {
# No compat spec past MSVC 2017
COMPAT_MKSPEC =
}

!isEmpty(COMPAT_MKSPEC):!$$COMPAT_MKSPEC: CONFIG += $$COMPAT_MKSPEC
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#
# qmake configuration for win32-clang-msvc2015

# qmake configuration for win32-clang-msvc
#
# Written for Clang 3.8 with Microsoft Visual C++ 2015 Update 1
# Notice: this uses the clang-cl wrapper
#

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
**
****************************************************************************/

#include "../win32-msvc2005/qplatformdefs.h"
#include "../win32-msvc/qplatformdefs.h"
34 changes: 0 additions & 34 deletions mkspecs/win32-clang-msvc2015/qplatformdefs.h

This file was deleted.

2 changes: 1 addition & 1 deletion mkspecs/win32-icc/qplatformdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
**
****************************************************************************/

#include "../win32-msvc2005/qplatformdefs.h"
#include "../win32-msvc/qplatformdefs.h"
8 changes: 8 additions & 0 deletions mkspecs/win32-msvc/qmake.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# qmake configuration for win32-msvc
#
# Written for Microsoft Visual C++ (all desktop versions)
#

include(../common/msvc-desktop.conf)
load(qt_config)
File renamed without changes.
8 changes: 0 additions & 8 deletions mkspecs/win32-msvc2005/qmake.conf

This file was deleted.

8 changes: 0 additions & 8 deletions mkspecs/win32-msvc2008/qmake.conf

This file was deleted.

8 changes: 0 additions & 8 deletions mkspecs/win32-msvc2010/qmake.conf

This file was deleted.

40 changes: 0 additions & 40 deletions mkspecs/win32-msvc2010/qplatformdefs.h

This file was deleted.

8 changes: 0 additions & 8 deletions mkspecs/win32-msvc2012/qmake.conf

This file was deleted.

40 changes: 0 additions & 40 deletions mkspecs/win32-msvc2012/qplatformdefs.h

This file was deleted.

8 changes: 0 additions & 8 deletions mkspecs/win32-msvc2013/qmake.conf

This file was deleted.

40 changes: 0 additions & 40 deletions mkspecs/win32-msvc2013/qplatformdefs.h

This file was deleted.

8 changes: 0 additions & 8 deletions mkspecs/win32-msvc2015/qmake.conf

This file was deleted.

40 changes: 0 additions & 40 deletions mkspecs/win32-msvc2015/qplatformdefs.h

This file was deleted.

8 changes: 0 additions & 8 deletions mkspecs/win32-msvc2017/qmake.conf

This file was deleted.

Loading

0 comments on commit 04403d5

Please sign in to comment.