[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.
This commit is contained in:
Joseph Huber 2024-03-04 17:38:42 -06:00 committed by GitHub
parent 40081a45a1
commit 07b1aebced
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 3 deletions

View File

@ -1,4 +1,7 @@
include(GNUInstallDirs)
if(NOT LLVM_RUNTIMES_GPU_BUILD)
include(GNUInstallDirs)
endif()
include(LLVMDistributionSupport)
include(LLVMProcessSources)
include(LLVM-Config)

View File

@ -122,8 +122,7 @@ endif()
# If we are targeting a GPU architecture in a runtimes build we want to ignore
# all the standard flag handling.
if("${LLVM_RUNTIMES_TARGET}" MATCHES "^amdgcn" OR
"${LLVM_RUNTIMES_TARGET}" MATCHES "^nvptx64")
if(LLVM_RUNTIMES_GPU_BUILD)
return()
endif()

View File

@ -151,6 +151,12 @@ endif()
# Avoid checking whether the compiler is working.
set(LLVM_COMPILER_CHECKED ON)
# This can be used to detect whether we're targeting a GPU architecture.
if("${LLVM_RUNTIMES_TARGET}" MATCHES "^amdgcn" OR
"${LLVM_RUNTIMES_TARGET}" MATCHES "^nvptx64")
set(LLVM_RUNTIMES_GPU_BUILD ON)
endif()
# Handle common options used by all runtimes.
include(AddLLVM)
include(HandleLLVMOptions)