File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -82,19 +82,22 @@ endif ()
82
82
include (CheckCXXCompilerFlag )
83
83
84
84
if (MSVC )
85
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251 /wd4141" )
86
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4018 /wd4267 /wd4715 /wd4146 /wd4129" )
85
+ add_compile_options (/wd4251 /wd4141 )
86
+ add_compile_options (/wd4018 /wd4267 /wd4715 /wd4146 /wd4129 )
87
+ add_compile_options (/EHsc )
88
+ else ()
89
+ add_compile_options (-fexceptions )
87
90
endif ()
88
91
89
92
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel" )
90
93
if (NOT XEUS_CPP_EMSCRIPTEN_WASM_BUILD )
91
- set ( CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -Wunused-parameter -Wextra -Wreorder" )
94
+ add_compile_options ( -Wunused-parameter -Wextra -Wreorder )
92
95
endif ()
93
96
94
97
95
98
CHECK_CXX_COMPILER_FLAG ("-std=c++17" HAS_CPP_17_FLAG )
96
99
if (HAS_CPP_17_FLAG )
97
- set ( CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -std=c++17" )
100
+ add_compile_options ( -std=c++17 )
98
101
else ()
99
102
message (FATAL_ERROR "Unsupported compiler -- xeus requires C++17 support!" )
100
103
endif ()
You can’t perform that action at this time.
0 commit comments