Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[NPU] Build and install flatbuffers to NPU developer package (#32367)

Lei Chen66539e48012b
diff --git a/thirdparty/dependencies.cmake b/thirdparty/dependencies.cmake
index 3d7f137ec99..d5e7698f5e9 100644
--- a/thirdparty/dependencies.cmake
+++ b/thirdparty/dependencies.cmake
@@ -424,7 +424,7 @@ endif()
# FlatBuffers
#
-if(ENABLE_OV_TF_LITE_FRONTEND)
+if(ENABLE_OV_TF_LITE_FRONTEND OR ENABLE_INTEL_NPU)
if(ENABLE_SYSTEM_FLATBUFFERS)
ov_cross_compile_define_debian_arch()
@@ -447,6 +447,15 @@ if(ENABLE_OV_TF_LITE_FRONTEND)
set(flatbuffers_COMPILER flatbuffers::flatc)
else()
add_subdirectory(thirdparty/flatbuffers EXCLUDE_FROM_ALL)
+ if(ENABLE_INTEL_NPU)
+ # NPU plugin requires flatbuffers to be built always
+ add_custom_target(npu_compiler_flatbuffers ALL DEPENDS flatbuffers flatc)
+ set(flatbuffers_root "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/flatbuffers/flatbuffers")
+ ov_developer_package_export_targets(TARGET flatbuffers
+ INSTALL_INCLUDE_DIRECTORIES "${flatbuffers_root}/include/")
+ ov_developer_package_export_targets(TARGET ProjectConfig)
+ install(TARGETS flatc DESTINATION "developer_package/bin" COMPONENT developer_package EXCLUDE_FROM_ALL)
+ endif()
endif()
# set additional variables, used in other places of our cmake scripts