cmake: add some note of MSVC undocumented flag

I added this flag but only explained what it is in the original
commit message, it may confuse future code readers without some
inline comments. So add some comments to avoid such issue.

Change-Id: I6a3c0f53c2bc58646cc70e45cacb1d0e40656c0a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Yuhang Zhao 2023-10-07 14:03:03 +08:00
parent b358672556
commit 88406f446c

View File

@ -250,6 +250,10 @@ function(qt_internal_set_exceptions_flags target exceptions_on)
if(MSVC)
set(_flag "/EHsc")
if((MSVC_VERSION GREATER_EQUAL 1929) AND NOT CLANG)
# Use the undocumented compiler flag to make our binary smaller on x64.
# https://devblogs.microsoft.com/cppblog/making-cpp-exception-handling-smaller-x64/
# NOTE: It seems we'll use this new exception handling model unconditionally without
# this hack since some unknown MSVC version.
set(_flag ${_flag} "/d2FH4")
endif()
endif()