Skip to content

Commit

Permalink
rapids_cpm_cccl now works as expected when given DOWNLOAD_ONLY ON (#…
Browse files Browse the repository at this point in the history
…527)

Only try to modify the CCCL::CCCL target when it exists, so we properly support `DOWNLOAD_ONLY ON` as is used by the rapids-cmake testing infra.

Authors:
  - Robert Maynard (https://github.com/robertmaynard)

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)

URL: #527
  • Loading branch information
robertmaynard authored Jan 24, 2024
1 parent 40d1a96 commit c8947b3
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions rapids-cmake/cpm/cccl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,22 @@ function(rapids_cpm_cccl)
EXPORT_SET ${_RAPIDS_INSTALL_EXPORT_SET} CONDITION to_install)
endif()

# Can be removed once we move to CCCL 2.3
#
target_compile_definitions(CCCL::CCCL INTERFACE THRUST_DISABLE_ABI_NAMESPACE)
target_compile_definitions(CCCL::CCCL INTERFACE THRUST_IGNORE_ABI_NAMESPACE_ERROR)
set(post_find_code
[=[
target_compile_definitions(CCCL::CCCL INTERFACE THRUST_DISABLE_ABI_NAMESPACE)
target_compile_definitions(CCCL::CCCL INTERFACE THRUST_IGNORE_ABI_NAMESPACE_ERROR)
]=])
include("${rapids-cmake-dir}/export/detail/post_find_package_code.cmake")
rapids_export_post_find_package_code(BUILD CCCL "${post_find_code}" EXPORT_SET
${_RAPIDS_BUILD_EXPORT_SET})
rapids_export_post_find_package_code(INSTALL CCCL "${post_find_code}" EXPORT_SET
${_RAPIDS_INSTALL_EXPORT_SET} CONDITION to_install)
if(TARGET CCCL::CCCL)
# Can be removed once we move to CCCL 2.3
#
target_compile_definitions(CCCL::CCCL INTERFACE THRUST_DISABLE_ABI_NAMESPACE)
target_compile_definitions(CCCL::CCCL INTERFACE THRUST_IGNORE_ABI_NAMESPACE_ERROR)
set(post_find_code
[=[
target_compile_definitions(CCCL::CCCL INTERFACE THRUST_DISABLE_ABI_NAMESPACE)
target_compile_definitions(CCCL::CCCL INTERFACE THRUST_IGNORE_ABI_NAMESPACE_ERROR)
]=])
include("${rapids-cmake-dir}/export/detail/post_find_package_code.cmake")
rapids_export_post_find_package_code(BUILD CCCL "${post_find_code}" EXPORT_SET
${_RAPIDS_BUILD_EXPORT_SET})
rapids_export_post_find_package_code(INSTALL CCCL "${post_find_code}" EXPORT_SET
${_RAPIDS_INSTALL_EXPORT_SET} CONDITION to_install)
endif()

# Propagate up variables that CPMFindPackage provides
set(CCCL_SOURCE_DIR "${CCCL_SOURCE_DIR}" PARENT_SCOPE)
Expand Down

0 comments on commit c8947b3

Please sign in to comment.