CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
60 lines
2.7 KiB
CMake
60 lines
2.7 KiB
CMake
#
|
|
# find_package(libcudacxx) config file.
|
|
#
|
|
# Defines a libcudacxx::libcudacxx target that may be linked from user projects to include
|
|
# libcudacxx.
|
|
|
|
if (TARGET libcudacxx::libcudacxx)
|
|
return()
|
|
endif()
|
|
|
|
function(_libcudacxx_declare_interface_alias alias_name ugly_name)
|
|
# 1) Only IMPORTED and ALIAS targets can be placed in a namespace.
|
|
# 2) When an IMPORTED library is linked to another target, its include
|
|
# directories are treated as SYSTEM includes.
|
|
# 3) nvcc will automatically check the CUDA Toolkit include path *before* the
|
|
# system includes. This means that the Toolkit libcudacxx will *always* be used
|
|
# during compilation, and the include paths of an IMPORTED libcudacxx::libcudacxx
|
|
# target will never have any effect.
|
|
# 4) This behavior can be fixed by setting the property NO_SYSTEM_FROM_IMPORTED
|
|
# on EVERY target that links to libcudacxx::libcudacxx. This would be a burden and a
|
|
# footgun for our users. Forgetting this would silently pull in the wrong libcudacxx!
|
|
# 5) A workaround is to make a non-IMPORTED library outside of the namespace,
|
|
# configure it, and then ALIAS it into the namespace (or ALIAS and then
|
|
# configure, that seems to work too).
|
|
add_library(${ugly_name} INTERFACE)
|
|
|
|
add_library(${alias_name} INTERFACE IMPORTED GLOBAL)
|
|
target_link_libraries(${alias_name} INTERFACE ${ugly_name})
|
|
endfunction()
|
|
|
|
#
|
|
# Setup targets
|
|
#
|
|
|
|
_libcudacxx_declare_interface_alias(libcudacxx::libcudacxx _libcudacxx_libcudacxx)
|
|
# Pull in the include dir detected by libcudacxx-config-version.cmake
|
|
set(_libcudacxx_INCLUDE_DIR "${_libcudacxx_VERSION_INCLUDE_DIR}"
|
|
CACHE INTERNAL "Location of libcudacxx headers."
|
|
)
|
|
unset(_libcudacxx_VERSION_INCLUDE_DIR CACHE) # Clear tmp variable from cache
|
|
target_include_directories(_libcudacxx_libcudacxx INTERFACE "${_libcudacxx_INCLUDE_DIR}")
|
|
target_compile_definitions(_libcudacxx_libcudacxx INTERFACE $<$<CONFIG:Debug>:CCCL_ENABLE_ASSERTIONS>)
|
|
|
|
#
|
|
# Standardize version info
|
|
#
|
|
|
|
set(LIBCUDACXX_VERSION ${${CMAKE_FIND_PACKAGE_NAME}_VERSION} CACHE INTERNAL "")
|
|
set(LIBCUDACXX_VERSION_MAJOR ${${CMAKE_FIND_PACKAGE_NAME}_VERSION_MAJOR} CACHE INTERNAL "")
|
|
set(LIBCUDACXX_VERSION_MINOR ${${CMAKE_FIND_PACKAGE_NAME}_VERSION_MINOR} CACHE INTERNAL "")
|
|
set(LIBCUDACXX_VERSION_PATCH ${${CMAKE_FIND_PACKAGE_NAME}_VERSION_PATCH} CACHE INTERNAL "")
|
|
set(LIBCUDACXX_VERSION_TWEAK ${${CMAKE_FIND_PACKAGE_NAME}_VERSION_TWEAK} CACHE INTERNAL "")
|
|
set(LIBCUDACXX_VERSION_COUNT ${${CMAKE_FIND_PACKAGE_NAME}_VERSION_COUNT} CACHE INTERNAL "")
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
if (NOT libcudacxx_CONFIG)
|
|
set(libcudacxx_CONFIG "${CMAKE_CURRENT_LIST_FILE}")
|
|
endif()
|
|
find_package_handle_standard_args(libcudacxx CONFIG_MODE)
|