File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed
Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ include(sail_enable_xopen_source)
3131include (sail_enable_warnings)
3232include (sail_install_cmake_config)
3333include (sail_test)
34+ include (sail_windows_enable_exception_handling)
3435include (sail_windows_install_pdb)
3536include (sail_windows_set_crt)
3637
@@ -136,6 +137,7 @@ sail_enable_warnings(INTERFACE_LIB sail-common-flags)
136137sail_enable_asan(INTERFACE_LIB sail-common-flags )
137138sail_enable_pic(INTERFACE_LIB sail-common-flags )
138139sail_enable_no_undefined(INTERFACE_LIB sail-common-flags )
140+ sail_windows_enable_exception_handling(INTERFACE_LIB sail-common-flags )
139141
140142# Enable C11
141143#
Original file line number Diff line number Diff line change 1+ # Intended to enable exception handling model on an interface library for Windows MSVC builds.
2+ #
3+ # Usage:
4+ # sail_windows_enable_exception_handling(INTERFACE_LIB sail-common-flags)
5+ #
6+ macro (sail_windows_enable_exception_handling)
7+ cmake_parse_arguments (SAIL_EH "" "INTERFACE_LIB" "" ${ARGN} )
8+
9+ if (NOT TARGET ${SAIL_EH_INTERFACE_LIB} )
10+ message (FATAL_ERROR "sail_windows_enable_exception_handling: Interface library '${SAIL_EH_INTERFACE_LIB} ' not found." )
11+ endif ()
12+
13+ if (MSVC )
14+ target_compile_options (${SAIL_EH_INTERFACE_LIB} INTERFACE "/EHsc" )
15+ endif ()
16+ endmacro ()
Original file line number Diff line number Diff line change @@ -115,10 +115,6 @@ endif()
115115
116116target_include_directories (sail-c++ PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /..>)
117117
118- if (MSVC )
119- target_compile_options (sail-c++ PRIVATE "/EHsc" )
120- endif ()
121-
122118target_link_libraries (sail-c++ PUBLIC sail-common sail sail-manip)
123119
124120# pkg-config integration
You can’t perform that action at this time.
0 commit comments