Skip to content

Commit

Permalink
Merge pull request #920 from jsji/localcopy
Browse files Browse the repository at this point in the history
[UR][L0] Copy prebuilt L0 to avoid leaking shared folder path
  • Loading branch information
pbalcer authored Oct 5, 2023
2 parents e6343f4 + 6a2c548 commit b38855e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions source/adapters/level_zero/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@

set(TARGET_NAME ur_adapter_level_zero)

# Copy L0 loader/headers locally to the build to avoid leaking their path.
set(LEVEL_ZERO_COPY_DIR ${CMAKE_CURRENT_BINARY_DIR}/level_zero_loader)
if (DEFINED L0_LIBRARY)
get_filename_component(LEVEL_ZERO_LIB_NAME "${L0_LIBRARY}" NAME)
set(LEVEL_ZERO_LIBRARY ${LEVEL_ZERO_COPY_DIR}/${LEVEL_ZERO_LIB_NAME})
message(STATUS "Copying Level Zero loader and headers to local build tree")
file(COPY ${L0_LIBRARY} DESTINATION ${LEVEL_ZERO_COPY_DIR} FOLLOW_SYMLINK_CHAIN)
endif()
if (DEFINED L0_INCLUDE_DIR)
set(LEVEL_ZERO_INCLUDE_DIR ${LEVEL_ZERO_COPY_DIR}/level_zero)
file(COPY ${L0_INCLUDE_DIR}/level_zero DESTINATION ${LEVEL_ZERO_COPY_DIR})
endif()

if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR)
message(STATUS "Download Level Zero loader and headers from github.com")

Expand Down

0 comments on commit b38855e

Please sign in to comment.