Summary:
If the target for these tools doesn't exist we should simply assume that
they will be provided externally. This allows building `libc` standalone
with an external installation of `clang`.
find_package(CUDAToolkit QUIET)
if(CUDAToolkit_FOUND)
get_filename_component(LIBC_CUDA_ROOT "${CUDAToolkit_BIN_DIR}" DIRECTORY ABSOLUTE)
- message(WARNING ${LIBC_CUDA_ROOT})
endif()
endif()
message(FATAL_ERROR "libc-hdrgen target missing unexpectedly")
endif()
if(LIBC_GPU_BUILD OR LIBC_GPU_ARCHITECTURES)
- list(APPEND extra_deps clang-offload-packager nvptx-arch amdgpu-arch)
+ foreach(dep clang-offload-packager nvptx-arch amdgpu-arch)
+ if(TARGET ${dep})
+ list(APPEND extra_deps ${dep})
+ endif()
+ endforeach()
endif()
endif()
if(NOT LLVM_RUNTIME_TARGETS)