meta-intel/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-protobuf-allow-target-protoc-to-be-built.patch
Anuj Mittal a499183991 openvino-inference-engine: use protobuf as a submodule
Use the version of protobuf fetched by OpenVINO instead of the
system version to avoid problems because of differences in what was
tested.

The build invokes protoc at build time so provide a qemu wrapper that
will allow that to be run on build machine.

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2023-06-14 09:10:58 +08:00

46 lines
2.1 KiB
Diff

From 450a1ba74eb5a6cf3946d8ae84b7de5bc97ccb35 Mon Sep 17 00:00:00 2001
From: Anuj Mittal <anuj.mittal@intel.com>
Date: Tue, 13 Jun 2023 12:34:08 +0800
Subject: [PATCH] protobuf: allow target protoc to be built
We can run target binaries using a qemu wrapper so allow these to be
built and run.
Upstream-Status: Inappropriate
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
cmake/developer_package/frontends/frontends.cmake | 2 +-
thirdparty/protobuf/CMakeLists.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmake/developer_package/frontends/frontends.cmake b/cmake/developer_package/frontends/frontends.cmake
index 897e6f8e3a6..32b136fcea9 100644
--- a/cmake/developer_package/frontends/frontends.cmake
+++ b/cmake/developer_package/frontends/frontends.cmake
@@ -146,7 +146,7 @@ macro(ov_add_frontend)
set(GENERATED_PROTO ${INFILE})
add_custom_command(
OUTPUT "${OUTPUT_PB_SRC}" "${OUTPUT_PB_HEADER}"
- COMMAND ${PROTOC_EXECUTABLE} ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} -I ${FILE_DIR} ${FILE_WE}.proto
+ COMMAND protoc ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} -I ${FILE_DIR} ${FILE_WE}.proto
DEPENDS ${PROTOC_DEPENDENCY} ${GENERATED_PROTO}
COMMENT "Running C++ protocol buffer compiler (${PROTOC_EXECUTABLE}) on ${GENERATED_PROTO}"
VERBATIM
diff --git a/thirdparty/protobuf/CMakeLists.txt b/thirdparty/protobuf/CMakeLists.txt
index 79e69a47b09..087f9e838c2 100644
--- a/thirdparty/protobuf/CMakeLists.txt
+++ b/thirdparty/protobuf/CMakeLists.txt
@@ -27,7 +27,7 @@ set(protobuf_WITH_ZLIB OFF CACHE BOOL "Build with zlib support" FORCE)
if(CMAKE_CROSSCOMPILING OR
(APPLE AND (HOST_X86_64 AND AARCH64)) OR
(MSVC AND (HOST_X86_64 AND (AARCH64 OR ARM))))
- set(protobuf_BUILD_PROTOC_BINARIES OFF CACHE BOOL "Build protoc binaries" FORCE)
+ set(protobuf_BUILD_PROTOC_BINARIES ON CACHE BOOL "Build protoc binaries" FORCE)
else()
set(protobuf_BUILD_PROTOC_BINARIES ON CACHE BOOL "Build protoc binaries" FORCE)
endif()
--
2.37.3