Remove default /EHsc compiler flag

This prevents warning D9025 (one command-line option overrides
another) on MSVC builds: some test targets are built with
the /EHs-c- which conflicts with /EHsc.
This commit is contained in:
Wojciech Kaluza 2018-05-26 01:40:06 +01:00 committed by Wojciech Kaluza
parent 41f0e24335
commit 421e7b4f29

View File

@ -38,6 +38,11 @@ macro(fix_default_compiler_settings_)
# We prefer more strict warning checking for building Google Test.
# Replaces /W3 with /W4 in defaults.
string(REPLACE "/W3" "/W4" ${flag_var} "${${flag_var}}")
# Prevent D9025 warning for targets that have exception handling
# turned off (/EHs-c- flag). Where required, exceptions are explicitly
# re-enabled using the cxx_exception_flags variable.
string(REPLACE "/EHsc" "" ${flag_var} "${${flag_var}}")
endforeach()
endif()
endmacro()