The `clang-offload-packager`. `nvptx-arch`, and `amdgpu-arch` tools are
required for building the GPU target of `libc`. This patch ensures that
we build this tool when directly building `libc` via `ninja libc` or similar.
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D147581
# "libc" is detected in LLVM_ENABLE_RUNTIMES.
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)
+ endif()
endif()
if(NOT LLVM_RUNTIME_TARGETS)
runtime_default_target(