[libomptarget][nfc] Add hook to easily disable building amdgcn bclib

[libomptarget][nfc] Add hook to easily disable building amdgcn bclib

This is useful when building LLVM with a toolchain that can't emit code
for amdgcn, e.g. because it overrides the include search path with headers
from another architecture, or the clang compiler is missing builtins.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D102229
This commit is contained in:
Jon Chesterfield 2021-05-11 17:23:08 +01:00
parent b20e150c9b
commit 72995a4bdf
1 changed files with 9 additions and 1 deletions

View File

@ -6,10 +6,18 @@
#
##===----------------------------------------------------------------------===##
#
# Build the AMDGCN Device RTL if the ROCM tools are available
# Build the AMDGCN Device RTL bitcode library using clang -ffreestanding
#
##===----------------------------------------------------------------------===##
set(LIBOMPTARGET_BUILD_AMDGCN_BCLIB TRUE CACHE BOOL
"Can be set to false to disable building this library.")
if (NOT LIBOMPTARGET_BUILD_AMDGCN_BCLIB)
libomptarget_say("Not building AMDGCN device RTL: Disabled by LIBOMPTARGET_BUILD_AMDGCN_BCLIB")
return()
endif()
# Copied from nvptx CMakeLists
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64")
set(aux_triple x86_64-unknown-linux-gnu)