Skip to content

Commit b9f2c74

Browse files
committed
add noexceptions test
1 parent c9eebca commit b9f2c74

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

tests/beman/inplace_vector/CMakeLists.txt

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,21 @@ if(BEMAN_INPLACE_VECTOR_FREESTANDING_DELETED)
4545
add_gtest(freestanding)
4646
endif()
4747

48-
# # only add noexception tests if NO_EXCEPTIONS option is set and compiler supports -fno-exceptions
49-
# if(
50-
# BEMAN_INPLACE_VECTOR_NO_EXCEPTIONS
51-
# AND (
52-
# CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
53-
# OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
54-
# )
55-
# )
56-
# add_gtest(noexceptions)
57-
# target_compile_options(
58-
# beman.inplace_vector.tests.noexceptions
59-
# PRIVATE -fno-exceptions
60-
# )
61-
# endif()
48+
# only add noexception tests if NO_EXCEPTIONS option is set and compiler supports -fno-exceptions
49+
if(
50+
BEMAN_INPLACE_VECTOR_NO_EXCEPTIONS
51+
AND (NOT BEMAN_INPLACE_VECTOR_FREESTANDING_DELETED)
52+
AND (
53+
CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
54+
OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
55+
)
56+
)
57+
add_gtest(noexceptions)
58+
target_compile_options(
59+
beman.inplace_vector.tests.noexceptions
60+
PRIVATE -fno-exceptions
61+
)
62+
endif()
6263

6364
# constexpr test
6465
add_executable(beman.inplace_vector.tests.constexpr constexpr.test.cpp)

0 commit comments

Comments
 (0)