Skip to content

Commit

Permalink
[UR] Choose in-tree unified-runtime directory if present
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kbenzie committed Jan 29, 2025
1 parent bf2b21e commit 915bcb4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sycl/cmake/modules/FetchUnifiedRuntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error")
endif()

if(SYCL_UR_USE_FETCH_CONTENT)
set(UR_INTREE_SOURCE_DIR "${LLVM_SOURCE_DIR}/../unified-runtime")
cmake_path(NORMAL_PATH UR_INTREE_SOURCE_DIR OUTPUT_VARIABLE UR_INTREE_SOURCE_DIR)

if(IS_DIRECTORY "${UR_INTREE_SOURCE_DIR}")
set(UR_INTREE_BINARY_DIR ${LLVM_BINARY_DIR}/unified-runtime)
add_subdirectory(${UR_INTREE_SOURCE_DIR} ${UR_INTREE_BINARY_DIR})
elseif(SYCL_UR_USE_FETCH_CONTENT)
include(FetchContent)

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

0 comments on commit 915bcb4

Please sign in to comment.