Skip to content

[LLVM][NFC] Ignore including the GNUInstallDirs on the GPU #83910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion llvm/cmake/modules/AddLLVM.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
include(GNUInstallDirs)
if(NOT LLVM_RUNTIMES_GPU_BUILD)
include(GNUInstallDirs)
endif()

include(LLVMDistributionSupport)
include(LLVMProcessSources)
include(LLVM-Config)
Expand Down
3 changes: 1 addition & 2 deletions llvm/cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
6 changes: 6 additions & 0 deletions runtimes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down