[1/1] package/opencv3: fix build with protobuf
diff mbox series

Message ID 20200113195757.905861-1-fontaine.fabrice@gmail.com
State New
Headers show
Series
  • [1/1] package/opencv3: fix build with protobuf
Related show

Commit Message

Fabrice Fontaine Jan. 13, 2020, 7:57 p.m. UTC
External protobuf is used instead of embedded one since commit
31c68a449ecd7da61ecfd909bea7ce799f9a6450. However it fails to build on:

[ 63%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/misc/caffe/opencv-caffe.pb.cc.o
In file included from /home/naourr/work/instance-0/output-1/build/opencv3-3.4.9/modules/dnn/misc/caffe/opencv-caffe.pb.cc:4:
/home/naourr/work/instance-0/output-1/build/opencv3-3.4.9/modules/dnn/misc/caffe/opencv-caffe.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
   17 | #error This file was generated by an older version of protoc which is
      |  ^~~~~
/home/naourr/work/instance-0/output-1/build/opencv3-3.4.9/modules/dnn/misc/caffe/opencv-caffe.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
   18 | #error incompatible with your Protocol Buffer headers.  Please
      |  ^~~~~
/home/naourr/work/instance-0/output-1/build/opencv3-3.4.9/modules/dnn/misc/caffe/opencv-caffe.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
   19 | #error regenerate this file with a newer version of protoc.
      |  ^~~~~
/home/naourr/work/instance-0/output-1/build/opencv3-3.4.9/modules/dnn/misc/caffe/opencv-caffe.pb.cc:12:10: fatal error: google/protobuf/wire_format_lite_inl.h: No such file or directory
   12 | #include <google/protobuf/wire_format_lite_inl.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix this error by setting PROTOBUF_UPDATE_FILES to ON

Fixes:
 - http://autobuild.buildroot.org/results/219258c90709fc34748929f1dcdf4f0649215e61

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/opencv3/opencv3.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/package/opencv3/opencv3.mk b/package/opencv3/opencv3.mk
index 89ed8f4278..cf38161fe2 100644
--- a/package/opencv3/opencv3.mk
+++ b/package/opencv3/opencv3.mk
@@ -290,7 +290,9 @@  OPENCV3_CONF_OPTS += -DWITH_PNG=OFF
 endif
 
 ifeq ($(BR2_PACKAGE_OPENCV3_WITH_PROTOBUF),y)
-OPENCV3_CONF_OPTS += -DWITH_PROTOBUF=ON
+OPENCV3_CONF_OPTS += \
+	-DPROTOBUF_UPDATE_FILES=ON \
+	-DWITH_PROTOBUF=ON
 OPENCV3_DEPENDENCIES += protobuf
 else
 OPENCV3_CONF_OPTS += -DWITH_PROTOBUF=OFF