Skip to content

Commit

Permalink
Ensure that cudax::Thrust target is only created once.
Browse files Browse the repository at this point in the history
  • Loading branch information
alliepiper committed Sep 17, 2024
1 parent 9a0f190 commit 2275294
Showing 1 changed file with 7 additions and 7 deletions.
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

0 comments on commit 2275294

Please sign in to comment.