[Openmp-commits] [PATCH] D125563: [Libomptarget] Remove global include directory from libomptarget
Joseph Huber via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Fri May 13 10:09:18 PDT 2022
jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, tianshilei1992.
Herald added a subscriber: mgorny.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added a project: OpenMP.
Herald added a subscriber: openmp-commits.
We used to globally include the libomptarget include directory for all
projects. This caused some conflicts with the other files named
"Debug.h". This patch changes the cmake to include these files via the
target include instead.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D125563
Files:
openmp/libomptarget/CMakeLists.txt
openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt
openmp/libomptarget/src/CMakeLists.txt
openmp/libomptarget/tools/deviceinfo/CMakeLists.txt
Index: openmp/libomptarget/tools/deviceinfo/CMakeLists.txt
===================================================================
--- openmp/libomptarget/tools/deviceinfo/CMakeLists.txt
+++ openmp/libomptarget/tools/deviceinfo/CMakeLists.txt
@@ -16,6 +16,9 @@
llvm_update_compile_flags(llvm-omp-device-info)
+target_include_directories(llvm-omp-device-info PRIVATE
+ ${LIBOMPTARGET_INCLUDE_DIR}
+)
target_link_libraries(llvm-omp-device-info PRIVATE
omp
omptarget
Index: openmp/libomptarget/src/CMakeLists.txt
===================================================================
--- openmp/libomptarget/src/CMakeLists.txt
+++ openmp/libomptarget/src/CMakeLists.txt
@@ -34,6 +34,8 @@
target_compile_definitions(omptarget PUBLIC OMPTARGET_PROFILE_ENABLED)
target_link_libraries(omptarget PRIVATE LLVMSupport)
endif()
+target_include_directories(omptarget PRIVATE
+ ${LIBOMPTARGET_INCLUDE_DIR})
target_link_libraries(omptarget PRIVATE
${CMAKE_DL_LIBS}
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
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
@@ -26,4 +26,6 @@
target_link_libraries(elf_common INTERFACE ${OPENMP_PTHREAD_LIB})
# Expose elf_common.h directory to the users of this library.
-target_include_directories(elf_common INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
+target_include_directories(elf_common PUBLIC
+ ${LIBOMPTARGET_INCLUDE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR})
Index: openmp/libomptarget/CMakeLists.txt
===================================================================
--- openmp/libomptarget/CMakeLists.txt
+++ openmp/libomptarget/CMakeLists.txt
@@ -70,7 +70,6 @@
endif()
set(LIBOMPTARGET_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
-include_directories(${LIBOMPTARGET_INCLUDE_DIR})
# Build target agnostic offloading library.
set(LIBOMPTARGET_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125563.429280.patch
Type: text/x-patch
Size: 2075 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220513/403742aa/attachment.bin>
More information about the Openmp-commits
mailing list