Skip to content

Commit

Permalink
Enable building static libs (#10545)
Browse files Browse the repository at this point in the history
This PR tracks private dependencies in the build and install export sets when building static libs. This is necessary for consumers to statically link `libcudf.a` via CMake.

Authors:
  - Paul Taylor (https://github.com/trxcllnt)

Approvers:
  - Mark Harris (https://github.com/harrism)
  - Robert Maynard (https://github.com/robertmaynard)

URL: #10545
  • Loading branch information
trxcllnt authored Apr 5, 2022
1 parent f359ec7 commit 5f4f232
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
15 changes: 15 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,21 @@ include(cmake/Modules/JitifyPreprocessKernels.cmake)
# find cuFile
include(cmake/Modules/FindcuFile.cmake)

# Workaround until https://github.com/rapidsai/rapids-cmake/issues/176 is resolved
if(NOT BUILD_SHARED_LIBS)
include("${rapids-cmake-dir}/export/find_package_file.cmake")
list(APPEND METADATA_KINDS BUILD INSTALL)
foreach(METADATA_KIND IN LISTS METADATA_KINDS)
rapids_export_find_package_file(
${METADATA_KIND} "${CUDF_SOURCE_DIR}/cmake/Modules/FindcuFile.cmake" cudf-exports
)
rapids_export_package(${METADATA_KIND} cuco cudf-exports)
rapids_export_package(${METADATA_KIND} ZLIB cudf-exports)
rapids_export_package(${METADATA_KIND} cuFile cudf-exports)
rapids_export_package(${METADATA_KIND} nvcomp cudf-exports)
endforeach()
endif()

# ##################################################################################################
# * library targets -------------------------------------------------------------------------------

Expand Down
7 changes: 5 additions & 2 deletions cpp/cmake/thirdparty/get_cucollections.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ function(find_and_configure_cucollections)
# Find or install cuCollections
rapids_cpm_find(
# cuCollections doesn't have a version yet
cuco 0.0
cuco 0.0.1
GLOBAL_TARGETS cuco::cuco
BUILD_EXPORT_SET cudf-exports
INSTALL_EXPORT_SET cudf-exports
CPM_ARGS GITHUB_REPOSITORY NVIDIA/cuCollections
GIT_TAG 6ec8b6dcdeceea07ab4456d32461a05c18864411
GIT_TAG fb58a38701f1c24ecfe07d8f1f208bbe80930da5
EXCLUDE_FROM_ALL ${BUILD_SHARED_LIBS}
OPTIONS "BUILD_TESTS OFF" "BUILD_BENCHMARKS OFF" "BUILD_EXAMPLES OFF"
)

Expand Down

0 comments on commit 5f4f232

Please sign in to comment.