Skip to content

Commit

Permalink
optimized build of cudf's tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lamarrr committed Sep 19, 2024
1 parent e12f014 commit 3b28ed1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ enable_testing()
include(rapids-test)
rapids_test_init()

add_library(cudftests_common OBJECT common/cudf_test_impl.cpp common/cudf_test_impl.cu)
target_link_libraries(cudftests_common PUBLIC cudftestutil GTest::gtest GTest::gmock)
target_compile_definitions(cudftests_common PUBLIC CUDF_TEST_EXCLUDE_GTEST=0)

# This function takes in a test name and test source and handles setting all of the associated
# properties and linking to build the test
function(ConfigureTest CMAKE_TEST_NAME)
Expand All @@ -41,9 +45,7 @@ function(ConfigureTest CMAKE_TEST_NAME)
set(_CUDF_TEST_STREAM_MODE cudf)
endif()

add_executable(
${CMAKE_TEST_NAME} ${_CUDF_TEST_UNPARSED_ARGUMENTS} cudf_test_impl.cu cudf_test_impl.cpp
)
add_executable(${CMAKE_TEST_NAME} ${_CUDF_TEST_UNPARSED_ARGUMENTS})
set_target_properties(
${CMAKE_TEST_NAME}
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CUDF_BINARY_DIR}/gtests>"
Expand All @@ -58,10 +60,9 @@ function(ConfigureTest CMAKE_TEST_NAME)

target_link_libraries(
${CMAKE_TEST_NAME}
PRIVATE cudftestutil GTest::gmock GTest::gmock_main GTest::gtest GTest::gtest_main
nvtx3::nvtx3-cpp $<TARGET_NAME_IF_EXISTS:conda_env> "${_CUDF_TEST_EXTRA_LIBS}"
PRIVATE cudftestutil cudftests_common GTest::gmock_main GTest::gtest_main nvtx3::nvtx3-cpp
$<TARGET_NAME_IF_EXISTS:conda_env> "${_CUDF_TEST_EXTRA_LIBS}"
)
target_compile_definitions(${CMAKE_TEST_NAME} PRIVATE CUDF_TEST_EXCLUDE_GTEST=0)
rapids_cuda_set_runtime(${CMAKE_TEST_NAME} USE_STATIC ${CUDA_STATIC_RUNTIME})
rapids_test_add(
NAME ${CMAKE_TEST_NAME}
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 3b28ed1

Please sign in to comment.