[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
This commit is contained in:
Shilei Tian 2022-03-05 22:37:46 -05:00
parent 86478c7ad8
commit 7f7c2c34b6
6 changed files with 2 additions and 15 deletions

View File

@ -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")

View File

@ -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)

View File

@ -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)

View File

@ -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.

View File

@ -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)

View File

@ -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")