From 8914f80b278c030b2a6cc505e809b51920e178ce Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 26 Aug 2021 09:51:07 +0200 Subject: [PATCH] qmake: Make it possible to set CONFIG += c11 with MSVC 19.28 The compiler that comes with Visual Studio 16.8 added support for setting the C11 standard with the /std:c11 flag. Add the respective version check in msvc-version.conf and set MSVC_VER and QMAKE_CFLAGS_C11 accordingly. Pick-to: 6.2 5.15 Task-number: QTBUG-89296 Change-Id: I29b54ee073a765918f5aa4ebb081b97c5cf471d7 Reviewed-by: Alexandru Croitor --- mkspecs/common/msvc-version.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mkspecs/common/msvc-version.conf b/mkspecs/common/msvc-version.conf index 26ff635e65..d9f38dae67 100644 --- a/mkspecs/common/msvc-version.conf +++ b/mkspecs/common/msvc-version.conf @@ -117,4 +117,10 @@ greaterThan(QMAKE_MSC_VER, 1919) { QMAKE_CXXFLAGS += -Zc:externConstexpr } +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 +} + !isEmpty(COMPAT_MKSPEC):!$$COMPAT_MKSPEC: CONFIG += $$COMPAT_MKSPEC