[Openmp-commits] [openmp] 1275ee3 - [OpenMP][amdgcn] Don't use in-tree clang if not available.

Michael Kruse via Openmp-commits openmp-commits at lists.llvm.org
Tue Aug 24 10:50:55 PDT 2021


Author: Michael Kruse
Date: 2021-08-24T12:50:49-05:00
New Revision: 1275ee3041049c69e9aaa7ac76af83a70340e054

URL: https://github.com/llvm/llvm-project/commit/1275ee3041049c69e9aaa7ac76af83a70340e054
DIFF: https://github.com/llvm/llvm-project/commit/1275ee3041049c69e9aaa7ac76af83a70340e054.diff

LOG: [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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt b/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
index 5d559f64934d0..7d10b1edabe04 100644
--- a/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
+++ b/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
@@ -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)


        


More information about the Openmp-commits mailing list