Skip to content

Commit 07b1aeb

Browse files
authored
[LLVM][NFC] Ignore including the GNUInstallDirs on the GPU (#83910)
Summary: I've begun treating GPU runtimes builds as cross-compiling with the LLVM infrastructure. However, we include a lot of random stuff that the GPU build isn't prepared to handle. This currently emits a warning, and while it's not striclty necessary, is annoying. This patch suppresses it by not including the standard GNU install directory resources when used from the GPU.
1 parent 40081a4 commit 07b1aeb

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Diff for: llvm/cmake/modules/AddLLVM.cmake

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
include(GNUInstallDirs)
1+
if(NOT LLVM_RUNTIMES_GPU_BUILD)
2+
include(GNUInstallDirs)
3+
endif()
4+
25
include(LLVMDistributionSupport)
36
include(LLVMProcessSources)
47
include(LLVM-Config)

Diff for: llvm/cmake/modules/HandleLLVMOptions.cmake

+1-2
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ endif()
122122

123123
# If we are targeting a GPU architecture in a runtimes build we want to ignore
124124
# all the standard flag handling.
125-
if("${LLVM_RUNTIMES_TARGET}" MATCHES "^amdgcn" OR
126-
"${LLVM_RUNTIMES_TARGET}" MATCHES "^nvptx64")
125+
if(LLVM_RUNTIMES_GPU_BUILD)
127126
return()
128127
endif()
129128

Diff for: runtimes/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ endif()
151151
# Avoid checking whether the compiler is working.
152152
set(LLVM_COMPILER_CHECKED ON)
153153

154+
# This can be used to detect whether we're targeting a GPU architecture.
155+
if("${LLVM_RUNTIMES_TARGET}" MATCHES "^amdgcn" OR
156+
"${LLVM_RUNTIMES_TARGET}" MATCHES "^nvptx64")
157+
set(LLVM_RUNTIMES_GPU_BUILD ON)
158+
endif()
159+
154160
# Handle common options used by all runtimes.
155161
include(AddLLVM)
156162
include(HandleLLVMOptions)

0 commit comments

Comments
 (0)