Skip to content

Commit

Permalink
updated libcudftestutil CMake linking logic for 24.12
Browse files Browse the repository at this point in the history
  • Loading branch information
lamarrr committed Oct 14, 2024
1 parent c45ff5f commit 5c38595
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
3 changes: 2 additions & 1 deletion cpp/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ target_link_libraries(cuspatial_benchmark_common
PUBLIC benchmark::benchmark
cudf::cudftestutil
ranger::ranger
cuspatial)
cuspatial GTest::gtest GTest::gmock
PRIVATE cudf::cudftestutil_impl)

target_compile_options(cuspatial_benchmark_common
PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${CUSPATIAL_CXX_FLAGS}>"
Expand Down
4 changes: 2 additions & 2 deletions cpp/cmake/thirdparty/get_cudf.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,7 +27,7 @@ function(find_and_configure_cudf)
set(cudf_components "")

if(BUILD_TESTS OR BUILD_BENCHMARKS)
list(APPEND global_targets cudf::cudftestutil)
list(APPEND global_targets cudf::cudftestutil cudf::cudftestutil_impl)
set(cudf_components COMPONENTS testing)
endif()

Expand Down
21 changes: 20 additions & 1 deletion cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@
###################################################################################################
# - compiler function -----------------------------------------------------------------------------

add_library(cuspatial_test_common OBJECT)

target_compile_features(cuspatial_test_common PUBLIC cxx_std_17 cuda_std_17)

set_target_properties(cuspatial_test_common
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CUSPATIAL_BINARY_DIR}/tests>"
INSTALL_RPATH "\$ORIGIN/../../../lib"
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CUDA_STANDARD 17
CUDA_STANDARD_REQUIRED ON
POSITION_INDEPENDENT_CODE ON
INTERFACE_POSITION_INDEPENDENT_CODE ON
)

target_link_libraries(cuspatial_test_common
PUBLIC cudf::cudftestutil GTest::gtest GTest::gmock
PRIVATE cudf::cudftestutil_impl)

function(ConfigureTest CMAKE_TEST_NAME)
add_executable(${CMAKE_TEST_NAME} ${ARGN})
target_compile_options(${CMAKE_TEST_NAME}
Expand All @@ -34,7 +53,7 @@ function(ConfigureTest CMAKE_TEST_NAME)
CUDA_STANDARD 17
CUDA_STANDARD_REQUIRED ON
)
target_link_libraries(${CMAKE_TEST_NAME} GTest::gtest_main GTest::gmock_main ranger::ranger cudf::cudftestutil cuspatial)
target_link_libraries(${CMAKE_TEST_NAME} GTest::gtest_main GTest::gmock_main ranger::ranger cudf::cudftestutil cuspatial cuspatial_test_common)
add_test(NAME ${CMAKE_TEST_NAME} COMMAND ${CMAKE_TEST_NAME})
install(
TARGETS ${CMAKE_TEST_NAME}
Expand Down

0 comments on commit 5c38595

Please sign in to comment.