headersclean: Compile with -std=c++latest, -Zc:__cplusplus on MSVC

c++latest does check that our headers also work with upcoming C++20
support in MSVC. It also implicitly sets -permissive-, which checks for
stricter standards compliance.

Pick-to: 6.1
Task-number: QTBUG-91117
Change-Id: Iaf1547191969213d570a1b2f59888ad04a7977ab
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Kai Köhne 2021-02-18 08:41:15 +01:00
parent 7c1aa0c48c
commit b58ca067da

View File

@ -190,7 +190,7 @@ function(qt_internal_add_headers_clean_target
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# -Za would enable strict standards behavior, but we can't add it because
# <windows.h> and <GL.h> violate the standards.
set(hcleanFLAGS -std:c++17 -WX -W3)
set(hcleanFLAGS -std:c++latest -Zc:__cplusplus -WX -W3)
# cl.exe needs a source path
get_filename_component(source_path "${QT_MKSPECS_DIR}/features/data/dummy.cpp" REALPATH)