[Openmp-commits] [PATCH] D104535: [NFC][libomptarget] Fixed -DLLVM_ENABLE_RUNTIMES="openmp" build.

Vyacheslav Zakharin via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Jun 18 07:24:31 PDT 2021


vzakhari created this revision.
Herald added subscribers: guansong, yaxunl, mgorny.
vzakhari requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: openmp-commits, sstefan1.
Herald added a project: OpenMP.

This should fix build issues reported in https://reviews.llvm.org/D103545#2826676


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104535

Files:
  openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
  openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt


Index: openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt
===================================================================
--- openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt
+++ openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt
@@ -15,6 +15,7 @@
 llvm_update_compile_flags(elf_common)
 set(LINK_LLVM_LIBS LLVMBinaryFormat LLVMObject LLVMSupport)
 target_link_libraries(elf_common INTERFACE ${LINK_LLVM_LIBS} ${LIBOMPTARGET_DEP_LIBELF_LIBRARIES})
+include_directories(${LIBOMPTARGET_LLVM_INCLUDE_DIRS})
 add_dependencies(elf_common ${LINK_LLVM_LIBS})
 
 # The code uses Debug.h, which requires threads support.
Index: openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
===================================================================
--- openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
+++ openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
@@ -33,9 +33,16 @@
   list(APPEND CMAKE_MODULE_PATH ${LLVM_CMAKE_DIR})
   include(AddLLVM)
 else()
+  # Note that OPENMP_STANDALONE_BUILD is FALSE, when
+  # openmp is built with -DLLVM_ENABLE_RUNTIMES="openmp" vs
+  # -DLLVM_ENABLE_PROJECTS="openmp", but openmp build
+  # is actually done as a standalone project build with many
+  # LLVM CMake variables propagated to it.
   list(APPEND LIBOMPTARGET_LLVM_INCLUDE_DIRS
     ${LLVM_MAIN_INCLUDE_DIR} ${LLVM_BINARY_DIR}/include
     )
+  message(STATUS
+    "Using LLVM include directories: ${LIBOMPTARGET_LLVM_INCLUDE_DIRS}")
 endif()
 
 ################################################################################


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104535.353001.patch
Type: text/x-patch
Size: 1605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210618/43b08c24/attachment-0001.bin>


More information about the Openmp-commits mailing list