diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt --- a/openmp/CMakeLists.txt +++ b/openmp/CMakeLists.txt @@ -39,6 +39,8 @@ set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang.exe) set(OPENMP_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++.exe) endif() + + list(APPEND LIBOMPTARGET_LLVM_INCLUDE_DIRS ${LLVM_MAIN_INCLUDE_DIR} ${LLVM_BINARY_DIR}/include) endif() # Check and set up common compiler flags. @@ -67,16 +69,16 @@ endif() # Attempt to locate LLVM source, required by libomptarget -if (NOT LIBOMPTARGET_LLVM_MAIN_INCLUDE_DIR) +if (NOT LIBOMPTARGET_LLVM_INCLUDE_DIRS) if (LLVM_MAIN_INCLUDE_DIR) - set(LIBOMPTARGET_LLVM_MAIN_INCLUDE_DIR ${LLVM_MAIN_INCLUDE_DIR}) + list(APPEND LIBOMPTARGET_LLVM_INCLUDE_DIRS ${LLVM_MAIN_INCLUDE_DIR}) elseif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../llvm/include) - set(LIBOMPTARGET_LLVM_MAIN_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../llvm/include) + list(APPENDset LIBOMPTARGET_LLVM_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../llvm/include) endif() endif() -if (NOT LIBOMPTARGET_LLVM_MAIN_INCLUDE_DIR) - message(STATUS "Missing definition for LIBOMPTARGET_LLVM_MAIN_INCLUDE_DIR, disabling libomptarget") +if (NOT LIBOMPTARGET_LLVM_INCLUDE_DIRS) + message(STATUS "Missing definition for LIBOMPTARGET_LLVM_INCLUDE_DIRS, disabling libomptarget") set(ENABLE_LIBOMPTARGET OFF) endif() diff --git a/openmp/libomptarget/CMakeLists.txt b/openmp/libomptarget/CMakeLists.txt --- a/openmp/libomptarget/CMakeLists.txt +++ b/openmp/libomptarget/CMakeLists.txt @@ -31,8 +31,8 @@ include(LibomptargetGetDependencies) # LLVM source tree is required at build time for libomptarget -if (NOT LIBOMPTARGET_LLVM_MAIN_INCLUDE_DIR) - message(FATAL_ERROR "Missing definition for LIBOMPTARGET_LLVM_MAIN_INCLUDE_DIR") +if (NOT LIBOMPTARGET_LLVM_INCLUDE_DIRS) + message(FATAL_ERROR "Missing definition for LIBOMPTARGET_LLVM_INCLUDE_DIRS") endif() # This is a list of all the targets that are supported/tested right now. diff --git a/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt b/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt --- a/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt +++ b/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt @@ -30,8 +30,8 @@ return() endif() -if (NOT LIBOMPTARGET_LLVM_MAIN_INCLUDE_DIR) - libomptarget_say("Not building AMDGPU plugin: Missing definition for LIBOMPTARGET_LLVM_MAIN_INCLUDE_DIR") +if (NOT LIBOMPTARGET_LLVM_INCLUDE_DIRS) + libomptarget_say("Not building AMDGPU plugin: Missing definition for LIBOMPTARGET_LLVM_INCLUDE_DIRS") return() endif() @@ -50,7 +50,7 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/impl - ${LIBOMPTARGET_LLVM_MAIN_INCLUDE_DIR} + ${LIBOMPTARGET_LLVM_INCLUDE_DIRS} ) add_library(omptarget.rtl.amdgpu SHARED diff --git a/openmp/libomptarget/src/CMakeLists.txt b/openmp/libomptarget/src/CMakeLists.txt --- a/openmp/libomptarget/src/CMakeLists.txt +++ b/openmp/libomptarget/src/CMakeLists.txt @@ -20,7 +20,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/omptarget.cpp ) -include_directories(${LIBOMPTARGET_LLVM_MAIN_INCLUDE_DIR}) +include_directories(${LIBOMPTARGET_LLVM_INCLUDE_DIRS}) # Build libomptarget library with libdl dependency. Add LLVMSupport # dependency if building in-tree with profiling enabled.