Skip to content

Commit 228f0e6

Browse files
authored
Merge pull request #856 from compnerd/foreign-spelling
build: tweak for portability with exceptions
2 parents 993c7cb + 97cda25 commit 228f0e6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Sources/_TestingInternals/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,14 @@ add_library(_TestingInternals STATIC
1717
WillThrow.cpp)
1818
target_include_directories(_TestingInternals PUBLIC
1919
${CMAKE_CURRENT_SOURCE_DIR}/include)
20-
target_compile_options(_TestingInternals PRIVATE
21-
-fno-exceptions)
20+
if("${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC" OR
21+
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
22+
target_compile_options(_TestingInternals PRIVATE
23+
/EHa-c)
24+
else()
25+
target_compile_options(_TestingInternals PRIVATE
26+
-fno-exceptions)
27+
endif()
2228

2329
if(NOT BUILD_SHARED_LIBS)
2430
# When building a static library, install the internal library archive

0 commit comments

Comments
 (0)