Skip to content

Commit aa33bf7

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 15a7cb2 commit aa33bf7

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
@@ -284,10 +284,25 @@ if(OPENMP_STANDALONE_BUILD)
284284
REQUIRED
285285
)
286286

287+
find_path (
288+
LIBOMP_INCLUDE_DIR
289+
NAMES
290+
omp.h
291+
HINTS
292+
${COMPILER_RESOURCE_DIR}/include
293+
${CMAKE_INSTALL_PREFIX}/include
294+
)
295+
296+
get_filename_component(LIBOMP_LIBRARY_DIR ${LIBOMP_STANDALONE} DIRECTORY)
297+
287298
set(OPENMP_TEST_FLAGS "" CACHE STRING
288299
"Extra compiler flags to send to the test compiler.")
289300
set(OPENMP_TEST_OPENMP_FLAGS ${OPENMP_TEST_COMPILER_OPENMP_FLAGS} CACHE STRING
290301
"OpenMP compiler flag to use for testing OpenMP runtime libraries.")
302+
set(LIBOMPTARGET_OPENMP_HEADER_FOLDER "${LIBOMP_INCLUDE_DIR}" CACHE STRING
303+
"Path to folder containing omp.h")
304+
set(LIBOMPTARGET_OPENMP_HOST_RTL_FOLDER "${LIBOMP_LIBRARY_DIR}" CACHE STRING
305+
"Path to folder containing libomp.so, and libLLVMSupport.so with profiling enabled")
291306
endif()
292307

293308
macro(pythonize_bool var)

0 commit comments

Comments
 (0)