Skip to content

Commit

Permalink
Make the unit tests runnable with RTTI disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
mikke89 committed Sep 22, 2023
1 parent a123c9d commit eeb380a
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ include_dependency("nanobench")
include_dependency("lodepng")
include_dependency("trompeloeil")

if(MSVC)
target_compile_definitions(doctest::doctest INTERFACE DOCTEST_CONFIG_USE_STD_HEADERS)
endif()
if(DISABLE_RTTI_AND_EXCEPTIONS)
target_compile_definitions(doctest::doctest INTERFACE DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS)
endif()

#===================================
# Common source files ==============
#===================================
Expand All @@ -41,10 +48,6 @@ add_executable(UnitTests ${UnitTests_HDR_FILES} ${UnitTests_SRC_FILES})
target_link_libraries(UnitTests RmlCore RmlDebugger doctest::doctest trompeloeil::trompeloeil ${sample_LIBRARIES})
add_common_target_options(UnitTests)

if(MSVC)
target_compile_definitions(UnitTests PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
endif()

doctest_discover_tests(UnitTests)


Expand Down Expand Up @@ -75,10 +78,6 @@ if(VISUAL_TESTS_CAPTURE_DIRECTORY)
target_compile_definitions(VisualTests PRIVATE RMLUI_VISUAL_TESTS_CAPTURE_DIRECTORY="${VISUAL_TESTS_CAPTURE_DIRECTORY}")
endif()

if(MSVC)
target_compile_definitions(VisualTests PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
endif()



#===================================
Expand All @@ -92,10 +91,6 @@ add_executable(Benchmarks ${Benchmarks_HDR_FILES} ${Benchmarks_SRC_FILES} ${Test
target_link_libraries(Benchmarks RmlCore RmlDebugger doctest::doctest nanobench::nanobench ${sample_LIBRARIES})
add_common_target_options(Benchmarks)

if(MSVC)
target_compile_definitions(Benchmarks PUBLIC DOCTEST_CONFIG_USE_STD_HEADERS)
endif()



#===================================
Expand Down

0 comments on commit eeb380a

Please sign in to comment.