Skip to content

Commit a4b1d48

Browse files
committed
Allow for crosscompilation of flatbuffer for NPU plugin
1 parent 98c39aa commit a4b1d48

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

thirdparty/dependencies.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,12 +449,16 @@ if(ENABLE_OV_TF_LITE_FRONTEND OR ENABLE_INTEL_NPU)
449449
add_subdirectory(thirdparty/flatbuffers EXCLUDE_FROM_ALL)
450450
if(ENABLE_INTEL_NPU)
451451
# NPU plugin requires flatbuffers to be built always
452-
add_custom_target(npu_compiler_flatbuffers ALL DEPENDS flatbuffers flatc)
452+
add_custom_target(npu_compiler_flatbuffers ALL DEPENDS flatbuffers ${flatbuffers_DEPENDENCY})
453453
set(flatbuffers_root "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/flatbuffers/flatbuffers")
454454
ov_developer_package_export_targets(TARGET flatbuffers
455455
INSTALL_INCLUDE_DIRECTORIES "${flatbuffers_root}/include/")
456456
ov_developer_package_export_targets(TARGET ProjectConfig)
457-
install(TARGETS flatc DESTINATION "developer_package/bin" COMPONENT developer_package EXCLUDE_FROM_ALL)
457+
install(FILES ${flatbuffers_COMPILER} DESTINATION "developer_package/bin" COMPONENT developer_package EXCLUDE_FROM_ALL)
458+
if (CMAKE_CROSSCOMPILING)
459+
# NPU compiler requires flatbuffers and flatc defined as target
460+
add_executable(flatc ALIAS flatbuffers::flatc)
461+
endif()
458462
endif()
459463
endif()
460464

0 commit comments

Comments
 (0)