Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Ensure that cudax::Thrust target is only created once.
  • Loading branch information
alliepiper committed Sep 25, 2024
commit c150d17db438e9652ea7c08e2c2b7232ffdf73d6
14 changes: 7 additions & 7 deletions cudax/cmake/cudaxBuildTargetList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,18 @@ function(_cn_init_target_list)
set(cudax_TARGETS "" CACHE INTERNAL "" FORCE)
endfunction()

# Bring in thrust as a dev dependency, only used in tests:
find_package(Thrust ${cudax_VERSION} EXACT CONFIG
NO_DEFAULT_PATH # Only check the explicit path in HINTS:
HINTS "${CCCL_SOURCE_DIR}/lib/cmake/thrust/"
)
thrust_create_target(cudax::Thrust)

function(_cn_add_target_to_target_list target_name dialect prefix)
add_library(${target_name} INTERFACE)

cudax_set_target_properties(${target_name} ${dialect} ${prefix})

# Bring in thrust as a dev dependency, only used in tests:
find_package(Thrust ${cudax_VERSION} EXACT CONFIG
NO_DEFAULT_PATH # Only check the explicit path in HINTS:
HINTS "${CCCL_SOURCE_DIR}/lib/cmake/thrust/"
)
thrust_create_target(cudax::Thrust)

target_link_libraries(${target_name} INTERFACE
cudax::cudax
cudax::Thrust
Expand Down