Skip to content

Commit

Permalink
Add flag to get standard-compliant exception handling (#68)
Browse files Browse the repository at this point in the history
Signed-off-by: Addisu Z. Taddese <[email protected]>
  • Loading branch information
azeey authored Oct 26, 2021
1 parent ddfb152 commit b764a7c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ if(WIN32)
set(executable_name "ign.rb")
endif()

if(MSVC)

# We always want this flag to be specified so we get standard-compliant
# exception handling.
# EHsc: Use standard-compliant exception handling
add_compile_options("/EHsc")
endif()

cmake_policy(PUSH)
cmake_policy(SET CMP0042 NEW)
add_library(backward SHARED backward.cc)
Expand All @@ -21,7 +29,7 @@ set_target_properties(backward PROPERTIES OUTPUT_NAME ${PROJECT_NAME}-backward)
set_target_properties(backward PROPERTIES CXX_STANDARD 14)
cmake_policy(POP)

if(WIN32)
if(MSVC)
# Suppress warning from vendored package
target_compile_options(backward PUBLIC /wd4267)
target_compile_options(backward PUBLIC /wd4996)
Expand Down

0 comments on commit b764a7c

Please sign in to comment.