2015-09-02 10:54:21 +00:00
|
|
|
#
|
|
|
|
# qmake configuration for Microsoft Visual Studio C/C++ Compiler
|
2020-06-05 07:24:37 +00:00
|
|
|
# This file is used by win32-msvc
|
2015-09-02 10:54:21 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Version-specific changes
|
|
|
|
#
|
|
|
|
|
2016-11-16 13:18:42 +00:00
|
|
|
isEmpty(QMAKE_MSC_VER): error("msvc-version.conf loaded but QMAKE_MSC_VER isn't set")
|
|
|
|
|
|
|
|
MSVC_VER = 8.0
|
2016-06-16 06:21:03 +00:00
|
|
|
COMPAT_MKSPEC = win32-msvc2005
|
2016-11-16 13:18:42 +00:00
|
|
|
|
|
|
|
greaterThan(QMAKE_MSC_VER, 1499) {
|
2015-09-02 10:54:21 +00:00
|
|
|
# Visual Studio 2008 (9.0) / Visual C++ 15.0 and up
|
2016-11-16 13:18:42 +00:00
|
|
|
MSVC_VER = 9.0
|
2021-11-09 14:06:18 +00:00
|
|
|
MSVC_TOOLSET_VER = 90
|
2016-06-16 06:21:03 +00:00
|
|
|
COMPAT_MKSPEC = win32-msvc2008
|
2015-09-02 10:54:21 +00:00
|
|
|
QMAKE_CFLAGS_MP = -MP
|
|
|
|
QMAKE_CXXFLAGS_MP = $$QMAKE_CFLAGS_MP
|
|
|
|
}
|
|
|
|
|
2016-11-16 13:18:42 +00:00
|
|
|
greaterThan(QMAKE_MSC_VER, 1599) {
|
2015-09-02 10:54:21 +00:00
|
|
|
# Visual Studio 2010 (10.0) / Visual C++ 16.0 and up
|
2016-11-16 13:18:42 +00:00
|
|
|
MSVC_VER = 10.0
|
2021-11-09 14:06:18 +00:00
|
|
|
MSVC_TOOLSET_VER = 100
|
2016-06-16 06:21:03 +00:00
|
|
|
COMPAT_MKSPEC = win32-msvc2010
|
2015-09-02 10:54:21 +00:00
|
|
|
MAKEFILE_GENERATOR = MSBUILD
|
|
|
|
|
|
|
|
QMAKE_CFLAGS_AVX = -arch:AVX
|
|
|
|
QMAKE_CFLAGS_AVX2 = -arch:AVX
|
|
|
|
|
|
|
|
VCPROJ_EXTENSION = .vcxproj
|
|
|
|
}
|
|
|
|
|
2016-11-16 13:18:42 +00:00
|
|
|
greaterThan(QMAKE_MSC_VER, 1699) {
|
2015-09-02 10:54:21 +00:00
|
|
|
# Visual Studio 2012 (11.0) / Visual C++ 17.0 and up
|
2016-11-16 13:18:42 +00:00
|
|
|
MSVC_VER = 11.0
|
2021-11-09 14:06:18 +00:00
|
|
|
MSVC_TOOLSET_VER = 110
|
2016-06-16 06:21:03 +00:00
|
|
|
COMPAT_MKSPEC = win32-msvc2012
|
2017-09-26 08:48:14 +00:00
|
|
|
QMAKE_CXXFLAGS_EXCEPTIONS_OFF = /wd4530 /wd4577
|
2015-09-02 10:54:21 +00:00
|
|
|
QT_CONFIG += c++11
|
|
|
|
CONFIG += c++11
|
|
|
|
}
|
|
|
|
|
2016-11-16 13:18:42 +00:00
|
|
|
greaterThan(QMAKE_MSC_VER, 1799) {
|
2015-09-02 10:54:21 +00:00
|
|
|
# Visual Studio 2013 (12.0) / Visual C++ 18.0 and up
|
2016-11-16 13:18:42 +00:00
|
|
|
MSVC_VER = 12.0
|
2021-11-09 14:06:18 +00:00
|
|
|
MSVC_TOOLSET_VER = 120
|
2016-06-16 06:21:03 +00:00
|
|
|
COMPAT_MKSPEC = win32-msvc2013
|
2015-09-02 10:54:21 +00:00
|
|
|
QMAKE_CFLAGS += -FS
|
2017-03-14 05:56:27 +00:00
|
|
|
QMAKE_CXXFLAGS += -FS -Zc:rvalueCast -Zc:inline
|
2015-09-02 10:54:21 +00:00
|
|
|
|
2017-04-03 23:05:18 +00:00
|
|
|
QMAKE_CFLAGS_F16C = -arch:AVX
|
2017-04-13 22:44:45 +00:00
|
|
|
QMAKE_CFLAGS_RDRND =
|
2019-08-14 04:59:26 +00:00
|
|
|
QMAKE_CFLAGS_RDSEED =
|
2017-04-03 23:05:18 +00:00
|
|
|
|
2016-11-16 13:18:42 +00:00
|
|
|
equals(QMAKE_MSC_VER, 1800) {
|
2015-09-02 10:54:21 +00:00
|
|
|
QMAKE_CFLAGS_RELEASE += -Zc:strictStrings
|
|
|
|
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings
|
|
|
|
QMAKE_CXXFLAGS_RELEASE += -Zc:strictStrings
|
|
|
|
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-16 13:18:42 +00:00
|
|
|
greaterThan(QMAKE_MSC_VER, 1899) {
|
2015-09-02 10:54:21 +00:00
|
|
|
# Visual Studio 2015 (14.0) / Visual C++ 19.0 and up
|
2016-11-16 13:18:42 +00:00
|
|
|
MSVC_VER = 14.0
|
2021-11-09 14:06:18 +00:00
|
|
|
MSVC_TOOLSET_VER = 140
|
2016-06-16 06:21:03 +00:00
|
|
|
COMPAT_MKSPEC = win32-msvc2015
|
2015-09-02 10:54:21 +00:00
|
|
|
QMAKE_CFLAGS += -Zc:strictStrings
|
|
|
|
QMAKE_CFLAGS_WARN_ON += -w44456 -w44457 -w44458
|
|
|
|
QMAKE_CFLAGS_AVX2 = -arch:AVX2
|
|
|
|
QMAKE_CXXFLAGS += -Zc:strictStrings -Zc:throwingNew
|
2016-07-06 07:39:27 +00:00
|
|
|
QMAKE_CXXFLAGS_WARN_ON += -w44456 -w44457 -w44458 -wd4577 -wd4467
|
2017-01-30 08:13:59 +00:00
|
|
|
|
2018-12-11 14:02:16 +00:00
|
|
|
# -utf-8 compiler option for Visual Studio 2015 Update 2
|
|
|
|
greaterThan(QMAKE_MSC_FULL_VER, 190023918): QMAKE_CFLAGS_UTF8_SOURCE = -utf-8
|
2015-09-02 10:54:21 +00:00
|
|
|
}
|
2016-11-16 13:18:42 +00:00
|
|
|
|
|
|
|
greaterThan(QMAKE_MSC_VER, 1909) {
|
|
|
|
# Visual Studio 2017 (15.0) / Visual C++ 19.10 and up
|
|
|
|
MSVC_VER = 15.0
|
2021-11-09 14:06:18 +00:00
|
|
|
MSVC_TOOLSET_VER = 141
|
2016-06-16 06:21:03 +00:00
|
|
|
COMPAT_MKSPEC = win32-msvc2017
|
2020-10-08 20:29:04 +00:00
|
|
|
QMAKE_CXXFLAGS += -permissive-
|
2017-11-15 23:14:35 +00:00
|
|
|
|
|
|
|
# Only Visual Studio 2017 version 15.3 / Visual C++ 19.11 & up have support
|
|
|
|
# for AVX-512. We enable the switches anyway and let configure check if they
|
|
|
|
# work.
|
|
|
|
QMAKE_CFLAGS_AVX512F = -arch:AVX512
|
|
|
|
QMAKE_CFLAGS_AVX512ER = -arch:AVX512
|
|
|
|
QMAKE_CFLAGS_AVX512CD = -arch:AVX512
|
|
|
|
QMAKE_CFLAGS_AVX512PF = -arch:AVX512
|
|
|
|
QMAKE_CFLAGS_AVX512DQ = -arch:AVX512
|
|
|
|
QMAKE_CFLAGS_AVX512BW = -arch:AVX512
|
|
|
|
QMAKE_CFLAGS_AVX512VL = -arch:AVX512
|
|
|
|
QMAKE_CFLAGS_AVX512IFMA = -arch:AVX512
|
|
|
|
QMAKE_CFLAGS_AVX512VBMI = -arch:AVX512
|
|
|
|
|
unify windows mkspecs: update definitions
mingw-w64 toolchain:
- add missing compiler definitions, similar to
'msvc-desktop.conf' toolchain,
- describe the reasons of missing compiler definitions, available in
'msvc-desktop.conf' toolchain,
- add missing 'QMAKE_CXXFLAGS' and 'QMAKE_CXXFLAGS_WARN_ON' variables,
similar to 'msvc-desktop.conf' toolchain.
ICC on Windows toolchain:
- add 'QMAKE_CFLAGS_OPTIMIZE_FULL' variable, similar to 'gcc-base.conf'
toolchain, though left it unused for now,
- add missing flags to 'QMAKE_CFLAGS' variable, similar to
'msvc-desktop.conf' toolchain,
- update deprecated 'Qwd' flag with 'Qdiag-disable',
- use 'QMAKE_CFLAGS_OPTIMIZE_DEBUG' variable instead of '-Od' flag,
similar to 'gcc-base.conf' toolchain (ICC implies '-O2' optimization
level by default, while MSVC implies '-Od'),
- add 'QMAKE_CFLAGS_UTF8_SOURCE' variable, similar to
'msvc-version.conf' toolchain; use a workaround to initialize it,
until '-utf-8' flag would be supported by ICC on Windows,
- update deprecated '-Qstd=c++1z' flag with '-Qstd=c++17',
MSVC toolchain:
- remove 'incremental' from MSVC 'CONFIG' variable, since it has
relevance only for the Unix generator,
- add 'QMAKE_CFLAGS_OPTIMIZE_DEBUG' variable, used in ICC for Windows
toolchain,
- add empty 'QMAKE_LIBS' variable, similar to 'win32-g++' toolchain,
- add 'uuid.lib' library to 'QMAKE_LIBS_GUI' variable, similar to
'win32-g++' toolchain,
- add C++14 and C++17 language support flags, though left them disabled
for now, similar to 'win32-icc' toolchain.
Change-Id: Ideef62d0422674184836faa655bfc5d09a5f612f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-01-10 15:51:54 +00:00
|
|
|
# MSVC partially supports the following, but '__cplusplus' definition is set
|
|
|
|
# as for C++98 until MSVC fully conforms with C++14, see
|
|
|
|
# https://developercommunity.visualstudio.com/content/problem/139261/msvc-incorrectly-defines-cplusplus.html
|
2018-05-08 05:55:09 +00:00
|
|
|
# Support became available in MSVC 2017 15.7:
|
|
|
|
greaterThan(QMAKE_MSC_VER, 1913) {
|
|
|
|
QMAKE_CXXFLAGS += -Zc:__cplusplus
|
|
|
|
QMAKE_CXXFLAGS_CXX14 = -std:c++14
|
|
|
|
QMAKE_CXXFLAGS_CXX1Z = -std:c++17
|
|
|
|
}
|
2016-11-16 13:18:42 +00:00
|
|
|
}
|
2016-06-16 06:21:03 +00:00
|
|
|
|
|
|
|
greaterThan(QMAKE_MSC_VER, 1910) {
|
|
|
|
# No compat spec past MSVC 2017
|
|
|
|
COMPAT_MKSPEC =
|
|
|
|
}
|
|
|
|
|
2019-02-12 08:09:50 +00:00
|
|
|
greaterThan(QMAKE_MSC_VER, 1919) {
|
|
|
|
# Visual Studio 2019 (16.0) / Visual C++ 19.20 and up
|
|
|
|
MSVC_VER = 16.0
|
2021-11-09 14:06:18 +00:00
|
|
|
MSVC_TOOLSET_VER = 142
|
2019-04-17 14:01:46 +00:00
|
|
|
QMAKE_CXXFLAGS_CXX2A = -std:c++latest
|
|
|
|
|
2020-10-12 13:13:05 +00:00
|
|
|
QMAKE_CXXFLAGS += -Zc:externConstexpr
|
2019-02-12 08:09:50 +00:00
|
|
|
}
|
|
|
|
|
2021-08-26 07:51:07 +00:00
|
|
|
greaterThan(QMAKE_MSC_VER, 1927) {
|
|
|
|
# Visual Studio 2019 (16.8 or 16.9) / Visual C++ 19.28 and up
|
|
|
|
MSVC_VER = 16.8
|
|
|
|
QMAKE_CFLAGS_C11 = /std:c11
|
2021-08-26 10:00:50 +00:00
|
|
|
QMAKE_CFLAGS_C17 = /std:c17
|
2021-08-26 07:51:07 +00:00
|
|
|
}
|
|
|
|
|
2022-02-09 21:41:36 +00:00
|
|
|
greaterThan(QMAKE_MSC_VER, 1928) {
|
|
|
|
# Visual Studio 2019 (16.10 or 16.11) / Visual C++ 19.29 and up
|
|
|
|
MSVC_VER = 16.10
|
|
|
|
|
|
|
|
# -std:c++20 compiler option for Visual Studio 2019 16.11.0 and up
|
|
|
|
greaterThan(QMAKE_MSC_FULL_VER, 192930132): QMAKE_CXXFLAGS_CXX2A = -std:c++20
|
|
|
|
}
|
|
|
|
|
2021-11-09 13:05:04 +00:00
|
|
|
greaterThan(QMAKE_MSC_VER, 1929) {
|
|
|
|
# Visual Studio 2022 (17.0) / Visual C++ 19.30 and up
|
|
|
|
MSVC_VER = 17.0
|
2021-11-09 14:06:18 +00:00
|
|
|
MSVC_TOOLSET_VER = 143
|
2021-11-09 13:05:04 +00:00
|
|
|
}
|
|
|
|
|
2016-06-16 06:21:03 +00:00
|
|
|
!isEmpty(COMPAT_MKSPEC):!$$COMPAT_MKSPEC: CONFIG += $$COMPAT_MKSPEC
|