Skip to content

Commit

Permalink
[OpenMP][amdgcn] Don't use in-tree clang if not available.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Meinersbur committed Aug 24, 2021
1 parent 2d8a2a9 commit 1275ee3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
Expand Up @@ -43,12 +43,15 @@ if (LLVM_DIR)
NO_DEFAULT_PATH)
find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
libomptarget_say("Building AMDGCN device RTL. Using clang: ${CLANG_TOOL}")
else()
elseif (LLVM_TOOL_CLANG_BUILD AND NOT CMAKE_CROSSCOMPILING AND NOT OPENMP_STANDALONE_BUILD)
# LLVM in-tree builds may use CMake target names to discover the tools.
set(CLANG_TOOL $<TARGET_FILE:clang>)
set(LINK_TOOL $<TARGET_FILE:llvm-link>)
set(OPT_TOOL $<TARGET_FILE:opt>)
libomptarget_say("Building AMDGCN device RTL. Using clang from in-tree build")
else()
libomptarget_say("Not building AMDGCN device RTL. No appropriate clang found")
return()
endif()

project(omptarget-amdgcn)
Expand Down

0 comments on commit 1275ee3

Please sign in to comment.