[Openmp-commits] [openmp] 5acdae1 - [OpenMP] Fixed an issue that wrong LLVM headers might be included when building libomptarget

Shilei Tian via Openmp-commits openmp-commits at lists.llvm.org
Wed Jan 6 14:07:42 PST 2021


Author: Shilei Tian
Date: 2021-01-06T17:07:36-05:00
New Revision: 5acdae1f9a772e16850b0ee9648d79a7c3becf23

URL: https://github.com/llvm/llvm-project/commit/5acdae1f9a772e16850b0ee9648d79a7c3becf23
DIFF: https://github.com/llvm/llvm-project/commit/5acdae1f9a772e16850b0ee9648d79a7c3becf23.diff

LOG: [OpenMP] Fixed an issue that wrong LLVM headers might be included when building libomptarget

Wrong LLVM headers might be included if we don't set `include_directories`
to a right place. This will cause a compilation error if LLVM is installed in
system directories.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D93737

Added: 
    

Modified: 
    openmp/libomptarget/src/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/src/CMakeLists.txt b/openmp/libomptarget/src/CMakeLists.txt
index 35ff4ed549cc..3fc7278f7fbd 100644
--- a/openmp/libomptarget/src/CMakeLists.txt
+++ b/openmp/libomptarget/src/CMakeLists.txt
@@ -21,6 +21,8 @@ set(LIBOMPTARGET_SRC_FILES
   ${CMAKE_CURRENT_SOURCE_DIR}/omptarget.cpp
 )
 
+include_directories(${LIBOMPTARGET_LLVM_MAIN_INCLUDE_DIR})
+
 # Build libomptarget library with libdl dependency. Add LLVMSupport
 # dependency if building in-tree with profiling enabled.
 if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMPTARGET_PROFILING))


        


More information about the Openmp-commits mailing list