Disable exceptions/RTTI for MSVC/clang-cl

This commit is contained in:
Luke Street 2020-04-17 16:40:46 -04:00
parent 0b05c906df
commit 75e5851e5b
1 changed files with 5 additions and 1 deletions

View File

@ -88,7 +88,10 @@ if(MSVC)
add_compile_options( add_compile_options(
# Disable exceptions # Disable exceptions
$<$<COMPILE_LANGUAGE:CXX>:/EHsc> $<$<COMPILE_LANGUAGE:CXX>:/EHsc->
# Disable RTTI
$<$<COMPILE_LANGUAGE:CXX>:/GR->
# Enforce various standards compliant behavior. # Enforce various standards compliant behavior.
$<$<COMPILE_LANGUAGE:CXX>:/permissive-> $<$<COMPILE_LANGUAGE:CXX>:/permissive->
@ -102,6 +105,7 @@ if(MSVC)
# Use latest C++ standard. # Use latest C++ standard.
$<$<COMPILE_LANGUAGE:CXX>:/std:c++latest> $<$<COMPILE_LANGUAGE:CXX>:/std:c++latest>
) )
add_compile_definitions(FMT_EXCEPTIONS=0 _HAS_EXCEPTIONS=0)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# Flags for MSVC (not clang-cl) # Flags for MSVC (not clang-cl)