Skip to content

Commit

Permalink
Fixed build with system level-zero (#28241)
Browse files Browse the repository at this point in the history
### Details:
 - When system level-zero is used, we cannot rely on submodule.
- It's a regression after
#27659
  • Loading branch information
ilya-lavrenov authored Jan 4, 2025
1 parent 6692cd7 commit 5250c9b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/plugins/intel_npu/src/utils/src/zero/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ add_library(openvino::npu_zero_utils ALIAS ${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME npu_zero_utils)

add_library(level-zero-headers INTERFACE)
set_property(TARGET level-zero-headers APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<BUILD_INTERFACE:${OpenVINO_SOURCE_DIR}/thirdparty/level_zero/level-zero/include>)
set_property(TARGET level-zero-headers APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:LevelZero::LevelZero,INTERFACE_INCLUDE_DIRECTORIES>)
add_library(LevelZero::Headers ALIAS level-zero-headers)

target_include_directories(${TARGET_NAME}
Expand All @@ -30,6 +30,7 @@ target_link_libraries(${TARGET_NAME} PUBLIC openvino::runtime::dev)
#
# targets install
#

ov_install_static_lib(${TARGET_NAME} ${NPU_PLUGIN_COMPONENT})

ov_developer_package_export_targets(TARGET openvino::npu_zero_utils
Expand All @@ -41,3 +42,14 @@ ov_install_static_lib(level-zero-ext ${NPU_PLUGIN_COMPONENT})

ov_developer_package_export_targets(TARGET level-zero-headers)
ov_install_static_lib(level-zero-headers ${NPU_PLUGIN_COMPONENT})

if(TARGET ze_loader)
ov_developer_package_export_targets(TARGET ze_loader)
ov_install_static_lib(ze_loader ${NPU_PLUGIN_COMPONENT})

add_dependencies(${TARGET_NAME} ze_loader)

# TODO: remove once https://github.com/oneapi-src/level-zero/pull/243 is merged and made a part of official release
ov_developer_package_export_targets(TARGET utils)
ov_install_static_lib(utils ${NPU_PLUGIN_COMPONENT})
endif()
2 changes: 1 addition & 1 deletion thirdparty/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ if(ENABLE_INTEL_NPU)
endif()
endif()

if(NOT libze_loader_FOUND)
if(NOT level_zero_FOUND)
add_subdirectory(thirdparty/level_zero EXCLUDE_FROM_ALL)
add_library(LevelZero::LevelZero ALIAS ze_loader)
endif()
Expand Down

0 comments on commit 5250c9b

Please sign in to comment.