Skip to content

Commit 7a59111

Browse files
committed
Add option to use local L0 include dir
Turning UMF_BUILD_LEVEL_ZERO_PROVIDER on in UR results in configuration errors as both projects try to fetch and build L0 loader.
1 parent d969819 commit 7a59111

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44

55
include(${UMF_CMAKE_SOURCE_DIR}/cmake/helpers.cmake)
66

7+
set(UMF_LEVEL_ZERO_INCLUDE_DIR "" CACHE FILEPATH "Directory containing the Level Zero Headers")
8+
79
# Compile definitions for UMF library.
810
#
911
# TODO: Cleanup the compile definitions across all the CMake files
1012
set(UMF_COMMON_COMPILE_DEFINITIONS UMF_VERSION=${UMF_VERSION})
1113

12-
if(UMF_BUILD_LEVEL_ZERO_PROVIDER)
14+
if(UMF_BUILD_LEVEL_ZERO_PROVIDER AND (UMF_BUILD_GPU_TESTS OR (NOT UMF_LEVEL_ZERO_INCLUDE_DIR)))
1315
include(FetchContent)
1416

1517
set(LEVEL_ZERO_LOADER_REPO "https://github.com/oneapi-src/level-zero.git")
@@ -35,6 +37,10 @@ if(UMF_BUILD_LEVEL_ZERO_PROVIDER)
3537
${level-zero-loader_SOURCE_DIR}/include
3638
CACHE PATH "Path to Level Zero Headers")
3739
message(STATUS "Level Zero include directory: ${LEVEL_ZERO_INCLUDE_DIRS}")
40+
elseif(UMF_BUILD_LEVEL_ZERO_PROVIDER)
41+
# Only header is needed to build UMF
42+
set(LEVEL_ZERO_INCLUDE_DIRS ${UMF_LEVEL_ZERO_INCLUDE_DIR})
43+
message(STATUS "Level Zero include directory: ${LEVEL_ZERO_INCLUDE_DIRS}")
3844
endif()
3945

4046
add_subdirectory(utils)

0 commit comments

Comments
 (0)