Skip to content

Commit

Permalink
[UR] Use relative xpti/xptifw source when available (#17099)
Browse files Browse the repository at this point in the history
In standalone UR builds, when the relative xpti/xptifw directories
exist, use those instead of using `FetchContentSparse_Declare` helper.
  • Loading branch information
kbenzie authored Feb 21, 2025
1 parent 5250c0e commit ae09897
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions unified-runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,16 @@ if(UR_ENABLE_TRACING)
add_compile_definitions(UR_ENABLE_TRACING)

if (UR_BUILD_XPTI_LIBS)
# fetch xpti proxy library for the tracing layer
FetchContentSparse_Declare(xpti https://github.com/intel/llvm.git "nightly-2024-10-22" "xpti")
set(UR_XPTI_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../xpti")
cmake_path(NORMAL_PATH UR_XPTI_SOURCE_DIR
OUTPUT_VARIABLE UR_XPTI_SOURCE_DIR)
if(IS_DIRECTORY "${UR_XPTI_SOURCE_DIR}")
FetchContent_Declare(xpti SOURCE_DIR "${UR_XPTI_SOURCE_DIR}")
else()
# fetch xpti proxy library for the tracing layer
FetchContentSparse_Declare(xpti https://github.com/intel/llvm.git "nightly-2024-10-22" "xpti")
endif()

FetchContent_MakeAvailable(xpti)

# set -fPIC for xpti since we are linking it with a shared library
Expand All @@ -150,7 +158,14 @@ if(UR_ENABLE_TRACING)
set(XPTI_DIR ${xpti_SOURCE_DIR})
set(XPTI_ENABLE_TESTS OFF CACHE INTERNAL "Turn off xptifw tests")

FetchContentSparse_Declare(xptifw https://github.com/intel/llvm.git "nightly-2024-10-22" "xptifw")
set(UR_XPTIFW_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../xptifw")
cmake_path(NORMAL_PATH UR_XPTIFW_SOURCE_DIR
OUTPUT_VARIABLE UR_XPTIFW_SOURCE_DIR)
if(IS_DIRECTORY "${UR_XPTI_SOURCE_DIR}")
FetchContent_Declare(xptifw SOURCE_DIR "${UR_XPTIFW_SOURCE_DIR}")
else()
FetchContentSparse_Declare(xptifw https://github.com/intel/llvm.git "nightly-2024-10-22" "xptifw")
endif()

FetchContent_MakeAvailable(xptifw)

Expand Down

0 comments on commit ae09897

Please sign in to comment.