[Openmp-commits] [PATCH] D108640: [OpenMP][amdgcn] Don't use in-tree clang if not available.

Michael Kruse via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Aug 24 10:00:09 PDT 2021


Meinersbur created this revision.
Meinersbur added reviewers: xgupta, JonChesterfield, bondhugula.
Meinersbur added a project: OpenMP.
Herald added subscribers: guansong, yaxunl, mgorny, jvesely.
Meinersbur requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

The use of `$<TARGET_FILE:clang>` was adapted too broadly from D101265 <https://reviews.llvm.org/D101265>.

Fixes llvm.org/PR51579

Also see discussion in D108534 <https://reviews.llvm.org/D108534>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108640

Files:
  openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt


Index: openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
===================================================================
--- openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
+++ openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
@@ -43,12 +43,15 @@
     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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108640.368378.patch
Type: text/x-patch
Size: 956 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210824/9860cafe/attachment.bin>


More information about the Openmp-commits mailing list