forked from OSchip/llvm-project
[openmp][devicertl] Handle missing clang_tool
Fixes github issues/52910 Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D117230
This commit is contained in:
parent
757e044dce
commit
d53b979596
|
@ -29,7 +29,12 @@ if (LLVM_DIR)
|
|||
find_program(LINK_TOOL llvm-link PATHS ${LLVM_TOOLS_BINARY_DIR}
|
||||
NO_DEFAULT_PATH)
|
||||
find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
|
||||
libomptarget_say("Building DeviceRTL. Using clang: ${CLANG_TOOL}")
|
||||
if ((NOT CLANG_TOOL) OR (NOT LINK_TOOL) OR (NOT OPT_TOOL))
|
||||
libomptarget_say("Not building DeviceRTL. Missing clang: ${CLANG_TOOL}, llvm-link: ${LINK_TOOL} or opt: ${OPT_TOOL}")
|
||||
return()
|
||||
else()
|
||||
libomptarget_say("Building DeviceRTL. Using clang: ${CLANG_TOOL}, llvm-link: ${LINK_TOOL} and opt: ${OPT_TOOL}")
|
||||
endif()
|
||||
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>)
|
||||
|
|
|
@ -39,10 +39,14 @@ endif()
|
|||
if (LLVM_DIR)
|
||||
# Builds that use pre-installed LLVM have LLVM_DIR set.
|
||||
find_program(CLANG_TOOL clang PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
|
||||
find_program(LINK_TOOL llvm-link PATHS ${LLVM_TOOLS_BINARY_DIR}
|
||||
NO_DEFAULT_PATH)
|
||||
find_program(LINK_TOOL llvm-link PATHS ${LLVM_TOOLS_BINARY_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}")
|
||||
if ((NOT CLANG_TOOL) OR (NOT LINK_TOOL) OR (NOT OPT_TOOL))
|
||||
libomptarget_say("Not building AMDGCN device RTL. Missing clang: ${CLANG_TOOL}, llvm-link: ${LINK_TOOL} or opt: ${OPT_TOOL}")
|
||||
return()
|
||||
else()
|
||||
libomptarget_say("Building AMDGCN device RTL. Using clang: ${CLANG_TOOL}, llvm-link: ${LINK_TOOL} and opt: ${OPT_TOOL}")
|
||||
endif()
|
||||
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>)
|
||||
|
|
Loading…
Reference in New Issue