Skip to content

Commit fe60bde

Browse files
committed
Compile doctest library ahead of time
1 parent 975ca6d commit fe60bde

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ endfunction()
3131

3232
include(FetchContent)
3333

34+
set(DOCTEST_WITH_MAIN_IN_STATIC_LIB ON)
35+
set(DOCTEST_NO_INSTALL ON)
36+
3437
FetchContent_Declare(doctest
3538
GIT_REPOSITORY https://github.com/doctest/doctest.git
3639
GIT_TAG v2.4.9)
3740
FetchContent_MakeAvailable(doctest)
3841

3942
set(RUNTIME_TEST_FILES
40-
${PROJECT_SOURCE_DIR}/tests/testing.cpp
4143
${PROJECT_SOURCE_DIR}/tests/tests_common.cpp
4244
${PROJECT_SOURCE_DIR}/tests/memory_tracker.cpp
4345
${PROJECT_SOURCE_DIR}/tests/runtime_tests_owner_misc.cpp
@@ -62,7 +64,7 @@ set(RUNTIME_TEST_FILES
6264

6365
add_executable(oup_runtime_tests ${RUNTIME_TEST_FILES})
6466
target_link_libraries(oup_runtime_tests PRIVATE oup::oup)
65-
target_link_libraries(oup_runtime_tests PRIVATE doctest::doctest)
67+
target_link_libraries(oup_runtime_tests PRIVATE doctest::doctest doctest::doctest_with_main)
6668
add_platform_definitions(oup_runtime_tests)
6769

6870
add_custom_target(oup_runtime_tests_run

tests/testing.cpp

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)