sieve of eratosthenes

This commit is contained in:
Barrett Ruth 2025-08-30 20:28:31 -05:00
parent 8f191a7e3f
commit 3c091551f5
4 changed files with 103 additions and 10 deletions

View file

@ -2,16 +2,19 @@ include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.14.0
)
GIT_TAG v1.14.0)
set(gtest_force_shared_crt
ON
CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
add_executable(test_bmath test_bmath.cc)
file(GLOB TEST_SOURCES "*.cc")
target_link_libraries(test_bmath PRIVATE bmath::bmath gtest_main)
foreach(TEST_SOURCE ${TEST_SOURCES})
get_filename_component(TEST_NAME ${TEST_SOURCE} NAME_WE)
add_executable(${TEST_NAME} ${TEST_SOURCE})
target_link_libraries(${TEST_NAME} PRIVATE bmath::bmath gtest_main)
include(GoogleTest)
gtest_discover_tests(test_bmath)
include(GoogleTest)
gtest_discover_tests(${TEST_NAME})
endforeach()