Skip to content

Commit f22bd27

Browse files
committed
Add flexibility to change level zero repo
1 parent 5083f4f commit f22bd27

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

source/adapters/level_zero/CMakeLists.txt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66

77
set(TARGET_NAME ur_adapter_level_zero)
88

9-
# Copy L0 loader/headers locally to the build to avoid leaking their path.
9+
# Copy Level Zero loader/headers locally to the build to avoid leaking their path.
1010
set(LEVEL_ZERO_COPY_DIR ${CMAKE_CURRENT_BINARY_DIR}/level_zero_loader)
11-
if (DEFINED L0_LIBRARY)
12-
get_filename_component(LEVEL_ZERO_LIB_NAME "${L0_LIBRARY}" NAME)
11+
if (DEFINED EXTERNAL_LEVEL_ZERO_LIBRARY)
12+
get_filename_component(LEVEL_ZERO_LIB_NAME "${EXTERNAL_LEVEL_ZERO_LIBRARY}" NAME)
1313
set(LEVEL_ZERO_LIBRARY ${LEVEL_ZERO_COPY_DIR}/${LEVEL_ZERO_LIB_NAME})
1414
message(STATUS "Copying Level Zero loader and headers to local build tree")
15-
file(COPY ${L0_LIBRARY} DESTINATION ${LEVEL_ZERO_COPY_DIR} FOLLOW_SYMLINK_CHAIN)
15+
file(COPY ${EXTERNAL_LEVEL_ZERO_LIBRARY} DESTINATION ${LEVEL_ZERO_COPY_DIR} FOLLOW_SYMLINK_CHAIN)
1616
endif()
17-
if (DEFINED L0_INCLUDE_DIR)
17+
if (DEFINED EXTERNAL_LEVEL_ZERO_INCLUDE_DIR)
1818
set(LEVEL_ZERO_INCLUDE_DIR ${LEVEL_ZERO_COPY_DIR}/level_zero)
19-
file(COPY ${L0_INCLUDE_DIR}/level_zero DESTINATION ${LEVEL_ZERO_COPY_DIR})
19+
file(COPY ${EXTERNAL_LEVEL_ZERO_INCLUDE_DIR}/level_zero DESTINATION ${LEVEL_ZERO_COPY_DIR})
2020
endif()
2121

2222
if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR)
@@ -33,8 +33,12 @@ if (NOT DEFINED LEVEL_ZERO_LIBRARY OR NOT DEFINED LEVEL_ZERO_INCLUDE_DIR)
3333
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option")
3434
endif()
3535

36-
set(LEVEL_ZERO_LOADER_REPO "https://github.com/oneapi-src/level-zero.git")
37-
set(LEVEL_ZERO_LOADER_TAG v1.16.1)
36+
if (NOT DEFINED LEVEL_ZERO_LOADER_REPO)
37+
set(LEVEL_ZERO_LOADER_REPO "https://github.com/oneapi-src/level-zero.git")
38+
endif()
39+
if (NOT DEFINED LEVEL_ZERO_LOADER_TAG)
40+
set(LEVEL_ZERO_LOADER_TAG v1.16.1)
41+
endif()
3842

3943
# Disable due to a bug https://github.com/oneapi-src/level-zero/issues/104
4044
set(CMAKE_INCLUDE_CURRENT_DIR OFF)

0 commit comments

Comments
 (0)