Skip to content

Commit 72995a4

Browse files
[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
1 parent b20e150 commit 72995a4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,18 @@
66
#
77
##===----------------------------------------------------------------------===##
88
#
9-
# Build the AMDGCN Device RTL if the ROCM tools are available
9+
# Build the AMDGCN Device RTL bitcode library using clang -ffreestanding
1010
#
1111
##===----------------------------------------------------------------------===##
1212

13+
set(LIBOMPTARGET_BUILD_AMDGCN_BCLIB TRUE CACHE BOOL
14+
"Can be set to false to disable building this library.")
15+
16+
if (NOT LIBOMPTARGET_BUILD_AMDGCN_BCLIB)
17+
libomptarget_say("Not building AMDGCN device RTL: Disabled by LIBOMPTARGET_BUILD_AMDGCN_BCLIB")
18+
return()
19+
endif()
20+
1321
# Copied from nvptx CMakeLists
1422
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64")
1523
set(aux_triple x86_64-unknown-linux-gnu)

0 commit comments

Comments
 (0)