From 421e7b4f29fc761c66d2773a1fc318a738a6d3da Mon Sep 17 00:00:00 2001 From: Wojciech Kaluza Date: Sat, 26 May 2018 01:40:06 +0100 Subject: 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. --- googletest/cmake/internal_utils.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake index 6448918..3a9b5bc 100644 --- a/googletest/cmake/internal_utils.cmake +++ b/googletest/cmake/internal_utils.cmake @@ -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() -- cgit v0.12