Skip to content

Commit

Permalink
🐛 Fix google test
Browse files Browse the repository at this point in the history
  • Loading branch information
yhs0602 committed Jan 2, 2025
1 parent bf73a9a commit f6ea370
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tests/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Google Test
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIRS})
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)

find_package(CUDAToolkit REQUIRED)

Expand All @@ -20,16 +26,15 @@ message(STATUS "CUDA is available in tests")
message(STATUS "CUDa toolkit libraries: ${CUDAToolkit_LIBRARY_DIR}")
target_link_libraries(
test_ipc PRIVATE
GTest::GTest
GTest::Main
Python3::Python
GTest::gtest_main
CUDA::cudart
CUDA::cudart_static
craftground
)
target_compile_options(test_ipc PRIVATE -D_GLIBCXX_USE_CXX11_ABI=1)


# Integrate with CTest
add_test(NAME CppTests COMMAND test_ipc)
include(GoogleTest)
gtest_discover_tests(test_ipc)

0 comments on commit f6ea370

Please sign in to comment.