Skip to content

Commit 1275ee3

Browse files
committed
[OpenMP][amdgcn] Don't use in-tree clang if not available.
The use of `$<TARGET_FILE:clang>` was adapted too broadly from D101265. Fixes llvm.org/PR51579 Also see discussion in D108534. Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D108640
1 parent 2d8a2a9 commit 1275ee3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,15 @@ if (LLVM_DIR)
4343
NO_DEFAULT_PATH)
4444
find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
4545
libomptarget_say("Building AMDGCN device RTL. Using clang: ${CLANG_TOOL}")
46-
else()
46+
elseif (LLVM_TOOL_CLANG_BUILD AND NOT CMAKE_CROSSCOMPILING AND NOT OPENMP_STANDALONE_BUILD)
4747
# LLVM in-tree builds may use CMake target names to discover the tools.
4848
set(CLANG_TOOL $<TARGET_FILE:clang>)
4949
set(LINK_TOOL $<TARGET_FILE:llvm-link>)
5050
set(OPT_TOOL $<TARGET_FILE:opt>)
5151
libomptarget_say("Building AMDGCN device RTL. Using clang from in-tree build")
52+
else()
53+
libomptarget_say("Not building AMDGCN device RTL. No appropriate clang found")
54+
return()
5255
endif()
5356

5457
project(omptarget-amdgcn)

0 commit comments

Comments
 (0)