Skip to content

Commit ca7380c

Browse files
committed
[offload] Define LIBOMPTARGET_OPENMP_*_FOLDER in standalone builds
Define `LIBOMPTARGET_OPENMP_HEADER_FOLDER` and `LIBOMPTARGET_OPENMP_HOST_RTL_FOLDER` needed for testing in standalone builds.
1 parent 05271f4 commit ca7380c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

offload/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,25 @@ if(OPENMP_STANDALONE_BUILD)
288288
REQUIRED
289289
)
290290

291+
find_path (
292+
LIBOMP_INCLUDE_DIR
293+
NAMES
294+
omp.h
295+
HINTS
296+
${COMPILER_RESOURCE_DIR}/include
297+
${CMAKE_INSTALL_PREFIX}/include
298+
)
299+
300+
get_filename_component(LIBOMP_LIBRARY_DIR ${LIBOMP_STANDALONE} DIRECTORY)
301+
291302
set(OPENMP_TEST_FLAGS "" CACHE STRING
292303
"Extra compiler flags to send to the test compiler.")
293304
set(OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING
294305
"OpenMP compiler flag to use for testing OpenMP runtime libraries.")
306+
set(LIBOMPTARGET_OPENMP_HEADER_FOLDER "${LIBOMP_INCLUDE_DIR}" CACHE STRING
307+
"Path to folder containing omp.h")
308+
set(LIBOMPTARGET_OPENMP_HOST_RTL_FOLDER "${LIBOMP_LIBRARY_DIR}" CACHE STRING
309+
"Path to folder containing libomp.so, and libLLVMSupport.so with profiling enabled")
295310
endif()
296311

297312
macro(pythonize_bool var)

0 commit comments

Comments
 (0)