Skip to content

Commit

Permalink
Changed cuco cmake function to return early if cuco has already been …
Browse files Browse the repository at this point in the history
…added as a target (#1746)

Changed cuco cmake function to return early if cuco has already been added as a target.  This matches the technique used by raft [here](https://github.com/rapidsai/raft/blob/a3af3895410c19f3e713caa608ea2024f6008350/cpp/cmake/thirdparty/get_cuco.cmake#L19).

Tested by doing a build and install of cuML, followed by a build of cuGraph and observing a CPM error about the alias target `cuco::cuco` already existing.  Made the change to return early if cuco is already a target and observed the cuGraph `libcugraph.so` build succeed.

Authors:
  - Rick Ratzel (https://github.com/rlratzel)

Approvers:
  - Chuck Hastings (https://github.com/ChuckHastings)
  - Dillon Cullinan (https://github.com/dillon-cullinan)

URL: #1746
  • Loading branch information
rlratzel authored Jul 29, 2021
1 parent aab2a5c commit 421e4be
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cpp/cmake/thirdparty/get_cuco.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

function(find_and_configure_cuco VERSION)

if(TARGET cuco::cuco)
return()
endif()

rapids_cpm_find(cuco ${VERSION}
GLOBAL_TARGETS cuco cuco::cuco
CPM_ARGS
Expand All @@ -26,9 +30,7 @@ function(find_and_configure_cuco VERSION)
"BUILD_EXAMPLES OFF"
)

if(NOT TARGET cuco::cuco)
add_library(cuco::cuco ALIAS cuco)
endif()
add_library(cuco::cuco ALIAS cuco)

endfunction()

Expand Down

0 comments on commit 421e4be

Please sign in to comment.