[PATCH] D108868: [libomptarget][amdcgn] Only add opt/llvm-link dependency if TARGET is available

Joachim Protze via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 30 08:33:53 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG5ea1c3711869: [libomptarget][amdcgn] Only add opt/llvm-link dependency if TARGET is available (authored by protze.joachim).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108868/new/

https://reviews.llvm.org/D108868

Files:
  llvm/runtimes/CMakeLists.txt
  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
@@ -163,6 +163,14 @@
 
 set(libname "omptarget-amdgcn")
 
+set(toolchain_deps "")
+if(TARGET llvm-link)
+  list(APPEND toolchain_deps llvm-link)
+endif()
+if(TARGET opt)
+  list(APPEND toolchain_deps opt)
+endif()
+
 foreach(mcpu ${mcpus})
   set(bc_files)
   add_cuda_bc_library(${cuda_sources})
@@ -171,7 +179,7 @@
   add_custom_command(
     OUTPUT ${bc_libname}
     COMMAND ${LINK_TOOL} ${bc_files} | ${OPT_TOOL} --always-inline -o ${OUTPUTDIR}/${bc_libname}
-    DEPENDS ${bc_files} llvm-link opt)
+    DEPENDS ${bc_files} ${toolchain_deps})
 
   add_custom_target(lib${libname}-${mcpu} ALL DEPENDS ${bc_libname})
 
Index: llvm/runtimes/CMakeLists.txt
===================================================================
--- llvm/runtimes/CMakeLists.txt
+++ llvm/runtimes/CMakeLists.txt
@@ -350,9 +350,14 @@
   # Create a runtimes target that uses this file as its top-level CMake file.
   # The runtimes target is a configuration of all the runtime libraries
   # together in a single CMake invocaiton.
+  set(extra_deps "")
   if("openmp" IN_LIST LLVM_ENABLE_RUNTIMES)
-    message(STATUS "Adding dependencies opt llvm-link")
-    set(extra_deps opt llvm-link)
+    if(TARGET opt)
+      list(APPEND extra_deps opt)
+    endif()
+    if(TARGET llvm-link)
+      list(APPEND extra_deps llvm-link)
+    endif()
   endif()
   if(NOT LLVM_RUNTIME_TARGETS)
     runtime_default_target(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108868.369451.patch
Type: text/x-patch
Size: 1630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210830/0e0ba698/attachment.bin>


More information about the llvm-commits mailing list