Skip to content

[UR] Add UR_EXTERNAL_DEPENDENCIES CMake option #17291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sycl/cmake/modules/FetchUnifiedRuntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ set(UR_BUILD_XPTI_LIBS OFF)
set(UR_ENABLE_SYMBOLIZER ON CACHE BOOL "Enable symbolizer for sanitizer layer.")
set(UR_ENABLE_TRACING ON)

set(UR_EXTERNAL_DEPENDENCIES "sycl-headers" CACHE LIST
"List of external CMake targets for executables/libraries to depend on" FORCE)

if("level_zero" IN_LIST SYCL_ENABLE_BACKENDS)
set(UR_BUILD_ADAPTER_L0 ON)
endif()
Expand Down
2 changes: 2 additions & 0 deletions unified-runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ option(UR_BUILD_XPTI_LIBS "Build the XPTI libraries when tracing is enabled" ON)
option(UR_STATIC_LOADER "Build loader as a static library" OFF)
option(UR_FORCE_LIBSTDCXX "Force use of libstdc++ in a build using libc++ on Linux" OFF)
option(UR_ENABLE_LATENCY_HISTOGRAM "Enable latncy histogram" OFF)
set(UR_EXTERNAL_DEPENDENCIES "" CACHE LIST
"List of external CMake targets for executables/libraries to depend on")
set(UR_DPCXX "" CACHE FILEPATH "Path of the DPC++ compiler executable")
set(UR_DPCXX_BUILD_FLAGS "" CACHE STRING "Build flags to pass to DPC++ when compiling device programs")
set(UR_SYCL_LIBRARY_DIR "" CACHE PATH
Expand Down
6 changes: 6 additions & 0 deletions unified-runtime/cmake/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ function(add_ur_executable name)
add_ur_target_compile_options(${name})
add_ur_target_exec_options(${name})
add_ur_target_link_options(${name})
if(UR_EXTERNAL_DEPENDENCIES)
add_dependencies(${name} ${UR_EXTERNAL_DEPENDENCIES})
endif()
endfunction()

function(add_ur_library name)
Expand All @@ -202,6 +205,9 @@ function(add_ur_library name)
$<$<STREQUAL:$<TARGET_LINKER_FILE_NAME:${name}>,link.exe>:LINKER:/DEPENDENTLOADFLAG:0x2000>
)
endif()
if(UR_EXTERNAL_DEPENDENCIES)
add_dependencies(${name} ${UR_EXTERNAL_DEPENDENCIES})
endif()
endfunction()

function(install_ur_library name)
Expand Down
Loading