From 07b1aebced8015c62d4ce0afe07358049afae5b1 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 4 Mar 2024 17:38:42 -0600 Subject: [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. --- runtimes/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'runtimes') diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt index 634ffe710b06..29b47b862c21 100644 --- a/runtimes/CMakeLists.txt +++ b/runtimes/CMakeLists.txt @@ -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) -- cgit v1.2.3