From 1275ee3041049c69e9aaa7ac76af83a70340e054 Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Tue, 24 Aug 2021 12:38:00 -0500 Subject: [PATCH] [OpenMP][amdgcn] Don't use in-tree clang if not available. The use of `$` 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 --- openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt b/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt index 5d559f6..7d10b1e 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 $) set(LINK_TOOL $) set(OPT_TOOL $) 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) -- 2.7.4