diff --git a/openmp/libomptarget/CMakeLists.txt b/openmp/libomptarget/CMakeLists.txt --- a/openmp/libomptarget/CMakeLists.txt +++ b/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) diff --git a/openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt b/openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt --- a/openmp/libomptarget/plugins/common/elf_common/CMakeLists.txt +++ b/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}) 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 @@ -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") diff --git a/openmp/libomptarget/tools/deviceinfo/CMakeLists.txt b/openmp/libomptarget/tools/deviceinfo/CMakeLists.txt --- a/openmp/libomptarget/tools/deviceinfo/CMakeLists.txt +++ b/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