Skip to content

Commit 1638be9

Browse files
authored
[UR] Choose in-tree unified-runtime directory if present (#16833)
Update the CMake build system to use the `<intel/llvm>/unified-runtime` directory if it exists. Fallback to using `FetchContent` when it does not exist. This is in preparation for moving UR development into the intel/llvm repo.
1 parent c2605dd commit 1638be9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sycl/cmake/modules/FetchUnifiedRuntime.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,13 @@ else()
7070
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error")
7171
endif()
7272

73-
if(SYCL_UR_USE_FETCH_CONTENT)
73+
set(UR_INTREE_SOURCE_DIR "${LLVM_SOURCE_DIR}/../unified-runtime")
74+
cmake_path(NORMAL_PATH UR_INTREE_SOURCE_DIR OUTPUT_VARIABLE UR_INTREE_SOURCE_DIR)
75+
76+
if(IS_DIRECTORY "${UR_INTREE_SOURCE_DIR}")
77+
set(UR_INTREE_BINARY_DIR ${LLVM_BINARY_DIR}/unified-runtime)
78+
add_subdirectory(${UR_INTREE_SOURCE_DIR} ${UR_INTREE_BINARY_DIR})
79+
elseif(SYCL_UR_USE_FETCH_CONTENT)
7480
include(FetchContent)
7581

7682
# The fetch_adapter_source function can be used to perform a separate content

0 commit comments

Comments
 (0)