From 8780fbb2ebff82f6e9b2dbae9a523d094d327b32 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Thu, 8 Oct 2020 22:29:04 +0200 Subject: Build Qt (and client apps using it) with /permissive- *Not* using /permissive- exposes Qt and client apps to interesting bugs and/or build failures, (e.g. QTBUG-87225, or 19b5520abfb5f66d4b83c7a18cc72d68673d098a). We demand strict conformance by any other compiler, it's time to demand it from MSVC too. The Windows headers themselves are clean starting from the Windows Fall Creators SDK (10.0.16299.0), and moreover Qt 6 will drop WinRT; therefore, the comment in the mkspecs does not apply any more. Since /permissive- implies /Zc:referenceBinding, drop that option. The other implied options are set on MSVC < 2017, but I leave them in to avoid tinkering with the fragile lists of C/C++ flags. Rename the CMake internal helper function to better describe what it does. Fixes: QTBUG-85633 Fixes: QTBUG-85637 Fixes: QTBUG-85635 Fixes: QTBUG-88244 Change-Id: Ie03fddb61aa066fdc14b7231c22e7108b4a02fbb Reviewed-by: Friedemann Kleint Reviewed-by: Kai Koehne Reviewed-by: Volker Hilsheimer --- mkspecs/common/msvc-version.conf | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'mkspecs/common/msvc-version.conf') diff --git a/mkspecs/common/msvc-version.conf b/mkspecs/common/msvc-version.conf index eee5cc0dd5..26ff635e65 100644 --- a/mkspecs/common/msvc-version.conf +++ b/mkspecs/common/msvc-version.conf @@ -78,7 +78,7 @@ greaterThan(QMAKE_MSC_VER, 1909) { # Visual Studio 2017 (15.0) / Visual C++ 19.10 and up MSVC_VER = 15.0 COMPAT_MKSPEC = win32-msvc2017 - QMAKE_CXXFLAGS += -Zc:referenceBinding + QMAKE_CXXFLAGS += -permissive- # 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 @@ -93,11 +93,6 @@ greaterThan(QMAKE_MSC_VER, 1909) { QMAKE_CFLAGS_AVX512IFMA = -arch:AVX512 QMAKE_CFLAGS_AVX512VBMI = -arch:AVX512 - # For now permissive fails as soon as UWP API comes into play. In qtbase this - # API is used in direct2d, but also in multimedia, positioning and sensors. - # We can try again with a later version of Visual Studio. - # QMAKE_CXXFLAGS_STRICTCXX = -permissive- - # 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 -- cgit v1.2.3