MySQL Forums
Forum List  »  Connector/C++

Re: building mysql-connector-c++ using system protobuf
Posted by: Vincent Fortier
Date: January 11, 2022 06:15AM

For additional context, cross-compiling on x64_64 works fine as the protoc binary do run on the host platform but when cross-compiling for other archs doesn't. Here is an example for armv7:

/bin/sh: 1: /bin/sh: 1: /bin/sh: 1: ../../protobuf/runtime_output_directory/protoc-3.11.4: Exec format error/bin/sh: 1:
../../protobuf/runtime_output_directory/protoc-3.11.4: Exec format error../../protobuf/runtime_output_directory/protoc-3.11.4: Exec format error

I've tried many variations based on https://cmake.org/cmake/help/latest/module/FindProtobuf.html but they all get discarded

-DPROTOBUF_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include
-DProtobuf_INCLUDE_DIRS=$(STAGING_INSTALL_PREFIX)/include
-DPROTOBUF_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/google/protobuf
-Dprotobuf_PROTOC_EXECUTABLE=$(WORK_DIR)/../../../native/protoc/work--Dprotobuf_INCLUDE_DIRS=$(STAGING_INSTALL_PREFIX)/include/google/protobuf
-Dprotobuf_LIBRARIES=$(STAGING_INSTALL_PREFIX)/lib

But they all get discarded:
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:

CROSS_COMPILE_ARM
protobuf_INCLUDE_DIRS
protobuf_LIBRARIES
protobuf_PROTOC_EXECUTABLE

Really, at first glance, having options for WITH_PROTOBUF (and others) would be best unless there is a way to avoid it differently?

Again, much thnx in advance.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: building mysql-connector-c++ using system protobuf
71
January 11, 2022 06:15AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.