Skip to content

Commit bfbf1f4

Browse files
committed
Add compile option /EHsc
1 parent ac76034 commit bfbf1f4

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

source/3rd_party/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ else()
3131
if (${BUILD_SHARED_LIBS})
3232
set_target_properties(nodesoup PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
3333
endif ()
34+
35+
if (MSVC)
36+
target_compile_options(nodesoup PRIVATE /EHsc)
37+
endif ()
3438
endif()
3539

3640
# Install (only necessary for static lib build)

source/matplot/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ if(MSVC)
102102
target_compile_options(matplot PUBLIC /wd4305)
103103
# Fix compile error caused by utf8 character in line_spec.cpp
104104
target_compile_options(matplot PUBLIC /utf-8)
105+
# Allow exceptions
106+
target_compile_options(matplot PRIVATE /EHsc)
105107
endif()
106108

107109
include(CheckSymbolExists)
@@ -137,10 +139,12 @@ if (BUILD_WITH_PEDANTIC_WARNINGS)
137139
else ()
138140
target_compile_options(matplot PRIVATE -Wall -Wextra -pedantic -Werror)
139141
# Allow the warnings related to the bundled CImg
140-
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
142+
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
141143
target_compile_options(matplot PRIVATE -Wno-null-pointer-arithmetic -Wno-char-subscripts)
142144
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
143145
target_compile_options(matplot PRIVATE -Wno-error=class-memaccess -Wno-class-memaccess)
146+
else ()
147+
message(ERROR "Cannot disable the relevant warnings for ${CMAKE_CXX_COMPILER_ID}")
144148
endif ()
145149
endif ()
146150
endif ()

0 commit comments

Comments
 (0)