Some configurations may require `-DCUDAToolkit_ROOT` to find CUDA
properly. This is currently not forwarded to the CMake invocation. This
patch adds a prefix so it will be visible when the runtimes build is
started.
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D147582
if(canon_name STREQUAL "LIBC")
list(APPEND prefixes "LLVM_LIBC")
list(APPEND prefixes "LIBC_")
+ # The `libc` project may require '-DCUDAToolkit_ROOT' in GPU mode.
+ if(LIBC_GPU_BUILD OR LIBC_GPU_ARCHITECTURES)
+ list(APPEND prefixes "CUDA")
+ endif()
endif()
string(FIND ${projName} "lib" LIB_IDX)