aboutsummaryrefslogtreecommitdiff
path: root/llvm/runtimes
diff options
context:
space:
mode:
authorJoseph Huber <jhuber6@vols.utk.edu>2023-04-04 18:32:00 -0500
committerJoseph Huber <jhuber6@vols.utk.edu>2023-04-04 19:50:34 -0500
commit7032f6d9503f5945ceee47e7338b8fcd1a0f6f83 (patch)
treee9bcd466e327b422317b813f720f335e5cab5714 /llvm/runtimes
parentb8fab512e9557dfcc7c886f0bf594f6c1e2f850d (diff)
downloadllvm-7032f6d9503f5945ceee47e7338b8fcd1a0f6f83.zip
llvm-7032f6d9503f5945ceee47e7338b8fcd1a0f6f83.tar.gz
llvm-7032f6d9503f5945ceee47e7338b8fcd1a0f6f83.tar.bz2
[libc] Forward CUDA options to the runtimes invocation of `libc`
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
Diffstat (limited to 'llvm/runtimes')
-rw-r--r--llvm/runtimes/CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index f4c697e..cc5f530 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -183,6 +183,10 @@ foreach(entry ${runtimes})
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)