Skip to content

Commit

Permalink
Disable exceptions on ICPC
Browse files Browse the repository at this point in the history
  • Loading branch information
falbrechtskirchinger committed Jul 28, 2022
1 parent 7777300 commit 9d35cdf
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,16 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
endif()

# disable exceptions for test-disabled_exceptions
json_test_set_test_options(test-disabled_exceptions COMPILE_DEFINITIONS JSON_NOEXCEPTION)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
json_test_set_test_options(test-disabled_exceptions COMPILE_OPTIONS -fno-exceptions)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# disabled due to https:/nlohmann/json/discussions/2824
#json_test_set_test_options(test-disabled_exceptions COMPILE_DEFINITIONS _HAS_EXCEPTIONS=0 COMPILE_OPTIONS /EH)
endif()
json_test_set_test_options(test-disabled_exceptions
COMPILE_DEFINITIONS
JSON_NOEXCEPTION
# disabled due to https:/nlohmann/json/discussions/2824
#$<$<CXX_COMPILER_ID:MSVC>:_HAS_EXCEPTIONS=0>
COMPILE_OPTIONS
$<$<CXX_COMPILER_ID:AppleClang,Clang,GNU,Intel,IntelLLVM>:-fno-exceptions>
# disabled due to https:/nlohmann/json/discussions/2824
#$<$<CXX_COMPILER_ID:MSVC>:/EH>
)

# raise timeout of expensive Unicode test
json_test_set_test_options(test-unicode4 TEST_PROPERTIES TIMEOUT 3000)
Expand Down

0 comments on commit 9d35cdf

Please sign in to comment.