[Openmp-commits] [openmp] 7f7c2c3 - [OpenMP][CMake] Clean up the CMake variable `LIBOMPTARGET_LLVM_INCLUDE_DIRS`

Shilei Tian via Openmp-commits openmp-commits at lists.llvm.org
Sat Mar 5 19:38:09 PST 2022


Author: Shilei Tian
Date: 2022-03-05T22:37:59-05:00
New Revision: 7f7c2c34b6b349e2183fb87cd1a608576e8f8e8a

URL: https://github.com/llvm/llvm-project/commit/7f7c2c34b6b349e2183fb87cd1a608576e8f8e8a
DIFF: https://github.com/llvm/llvm-project/commit/7f7c2c34b6b349e2183fb87cd1a608576e8f8e8a.diff

LOG: [OpenMP][CMake] Clean up the CMake variable `LIBOMPTARGET_LLVM_INCLUDE_DIRS`

`LIBOMPTARGET_LLVM_INCLUDE_DIRS` is currently checked and included for
multiple times redundantly. This patch is simply a clean up.

Reviewed By: jhuber6

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

Added: 
    

Modified: 
    openmp/libomptarget/CMakeLists.txt
    openmp/libomptarget/DeviceRTL/CMakeLists.txt
    openmp/libomptarget/plugins/amdgpu/CMakeLists.txt
    openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt
    openmp/libomptarget/plugins/cuda/CMakeLists.txt
    openmp/libomptarget/src/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/CMakeLists.txt b/openmp/libomptarget/CMakeLists.txt
index 8d2f100f97b8c..4f48311db6f3e 100644
--- a/openmp/libomptarget/CMakeLists.txt
+++ b/openmp/libomptarget/CMakeLists.txt
@@ -35,6 +35,8 @@ if (NOT LIBOMPTARGET_LLVM_INCLUDE_DIRS)
   message(FATAL_ERROR "Missing definition for LIBOMPTARGET_LLVM_INCLUDE_DIRS")
 endif()
 
+include_directories(${LIBOMPTARGET_LLVM_INCLUDE_DIRS})
+
 # This is a list of all the targets that are supported/tested right now.
 set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} aarch64-unknown-linux-gnu")
 set (LIBOMPTARGET_ALL_TARGETS "${LIBOMPTARGET_ALL_TARGETS} aarch64-unknown-linux-gnu-newDriver")

diff  --git a/openmp/libomptarget/DeviceRTL/CMakeLists.txt b/openmp/libomptarget/DeviceRTL/CMakeLists.txt
index 729adff3f88bc..34b488c11fa45 100644
--- a/openmp/libomptarget/DeviceRTL/CMakeLists.txt
+++ b/openmp/libomptarget/DeviceRTL/CMakeLists.txt
@@ -18,11 +18,6 @@ if (NOT LIBOMPTARGET_BUILD_DEVICERTL_BCLIB)
   return()
 endif()
 
-if (NOT LIBOMPTARGET_LLVM_INCLUDE_DIRS)
-  libomptarget_say("Not building DeviceRTL: Missing definition for LIBOMPTARGET_LLVM_INCLUDE_DIRS")
-  return()
-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)

diff  --git a/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt b/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt
index 145181206ff81..1968ae05e9f20 100644
--- a/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt
+++ b/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt
@@ -32,11 +32,6 @@ if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(ppc64le)|(aarch64)$" AND CMAKE_
   return()
 endif()
 
-if (NOT LIBOMPTARGET_LLVM_INCLUDE_DIRS)
-  libomptarget_say("Not building AMDGPU plugin: Missing definition for LIBOMPTARGET_LLVM_INCLUDE_DIRS")
-  return()
-endif()
-
 ################################################################################
 # Define the suffix for the runtime messaging dumps.
 add_definitions(-DTARGET_NAME=AMDGPU)
@@ -50,7 +45,6 @@ endif()
 
 include_directories(
   ${CMAKE_CURRENT_SOURCE_DIR}/impl
-  ${LIBOMPTARGET_LLVM_INCLUDE_DIRS}
 )
 
 set(LIBOMPTARGET_DLOPEN_LIBHSA OFF)

diff  --git a/openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt b/openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt
index 457aab968556e..c30edd3864f4c 100644
--- a/openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt
+++ b/openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt
@@ -20,7 +20,6 @@ if (LLVM_LINK_LLVM_DYLIB)
   set(LINK_LLVM_LIBS LLVM)
 endif()
 target_link_libraries(elf_common INTERFACE ${LINK_LLVM_LIBS})
-include_directories(${LIBOMPTARGET_LLVM_INCLUDE_DIRS})
 add_dependencies(elf_common ${LINK_LLVM_LIBS})
 
 # The code uses Debug.h, which requires threads support.

diff  --git a/openmp/libomptarget/plugins/cuda/CMakeLists.txt b/openmp/libomptarget/plugins/cuda/CMakeLists.txt
index 4329386fda6f4..ad878bf210b33 100644
--- a/openmp/libomptarget/plugins/cuda/CMakeLists.txt
+++ b/openmp/libomptarget/plugins/cuda/CMakeLists.txt
@@ -31,7 +31,6 @@ add_definitions(-DTARGET_NAME=CUDA)
 
 include_directories(
   ${LIBOMPTARGET_DEP_LIBELF_INCLUDE_DIRS}
-  ${LIBOMPTARGET_LLVM_INCLUDE_DIRS}
 )
 
 set(LIBOMPTARGET_DLOPEN_LIBCUDA OFF)

diff  --git a/openmp/libomptarget/src/CMakeLists.txt b/openmp/libomptarget/src/CMakeLists.txt
index ff85d7e7134f1..db5b212c7ae7a 100644
--- a/openmp/libomptarget/src/CMakeLists.txt
+++ b/openmp/libomptarget/src/CMakeLists.txt
@@ -23,8 +23,6 @@ set(LIBOMPTARGET_SRC_FILES
 
 set(LIBOMPTARGET_SRC_FILES ${LIBOMPTARGET_SRC_FILES} PARENT_SCOPE)
 
-include_directories(${LIBOMPTARGET_LLVM_INCLUDE_DIRS})
-
 # Build libomptarget library with libdl dependency.
 add_library(omptarget SHARED ${LIBOMPTARGET_SRC_FILES})
 set_target_properties(omptarget PROPERTIES INSTALL_RPATH "$ORIGIN" BUILD_RPATH "$ORIGIN")


        


More information about the Openmp-commits mailing list