Explain why we can't use -Za in MSVC headersclean check

Bring back & update comment on -Za, which was removed
in 8bf60251 (in turn reverted in commit 2dcc3059).

For the details on -Za vs -permissive, see
   https://devblogs.microsoft.com/cppblog/permissive-switch/:
and the official Microsoft documentation.

This amends 2dcc30592b.

Change-Id: Ibeb135218dd0a17eddf821ad79246906993c586f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Michal Klocek 2023-07-10 09:26:27 +02:00 committed by Kai Köhne
parent 84a33c67c6
commit ec2faefbc2

View File

@ -183,6 +183,9 @@ function(qt_internal_add_headersclean_target module_target module_headers)
)
set(input_header_path_type ABSOLUTE)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# Note we can't enable -Za, as it does not support certain key Microsoft SDK header files
# we use. Microsoft suggests to use /permissive- instead, which is implicity set by
# -std:c++latest.
set(hcleanFLAGS -std:c++latest -Zc:__cplusplus -WX -W3 -EHsc)
# Because we now add `-DNOMINMAX` to `PlatformCommonInternal`.