[Openmp-commits] [PATCH] D128129: [libomptarget]Add a trap for external omptarget from LLVM
Ye Luo via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Sat Jun 18 19:10:02 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG54b45afb599a: [libomptarget]Add a trap for external omptarget from LLVM (authored by ye-luo).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128129/new/
https://reviews.llvm.org/D128129
Files:
openmp/libomptarget/DeviceRTL/CMakeLists.txt
openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
Index: openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
===================================================================
--- openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
+++ openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
@@ -32,6 +32,10 @@
list(APPEND LIBOMPTARGET_LLVM_INCLUDE_DIRS ${LLVM_INCLUDE_DIRS})
list(APPEND CMAKE_MODULE_PATH ${LLVM_CMAKE_DIR})
include(AddLLVM)
+ if(TARGET omptarget)
+ message(FATAL_ERROR "CMake target 'omptarget' already exists. "
+ "Use an LLVM installation that doesn't expose its 'omptarget' target.")
+ endif()
else()
# Note that OPENMP_STANDALONE_BUILD is FALSE, when
# openmp is built with -DLLVM_ENABLE_RUNTIMES="openmp" vs
Index: openmp/libomptarget/DeviceRTL/CMakeLists.txt
===================================================================
--- openmp/libomptarget/DeviceRTL/CMakeLists.txt
+++ openmp/libomptarget/DeviceRTL/CMakeLists.txt
@@ -20,6 +20,7 @@
if (LLVM_DIR)
# Builds that use pre-installed LLVM have LLVM_DIR set.
+ # A standalone or LLVM_ENABLE_RUNTIMES=openmp build takes this route
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)
@@ -32,6 +33,7 @@
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.
+ # A LLVM_ENABLE_PROJECTS=openmp build takes this route
set(CLANG_TOOL $<TARGET_FILE:clang>)
set(LINK_TOOL $<TARGET_FILE:llvm-link>)
set(OPT_TOOL $<TARGET_FILE:opt>)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128129.438165.patch
Type: text/x-patch
Size: 1698 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220619/74bc081e/attachment.bin>
More information about the Openmp-commits
mailing list