Compiling gRPC C++ for esp-idf

mmmunir966
Posts: 12
Joined: Tue Feb 08, 2022 2:02 pm

Compiling gRPC C++ for esp-idf

Postby mmmunir966 » Fri Jul 01, 2022 10:33 am

Hi,
I want to build gRPC for esp-idf to use it with protobuf. When I try to include the grpc.pb.h and grpc.pb.cc files, I get platform errors which seems gRPC does not support espressif.
I also tried to direclty include the gRPC package using

Code: Select all

find_packkage(gRPC CONFIG REQUIRED)
This generates an error like
Could not find a configuration file for package "gRPC" that is compatible with requested version "".
The following configuration files were considered but not accepted:
C:/vcpkg/installed/x64-windows/share/grpc/gRPCConfig.cmake, version 1.44.0 (64bit)
Then i updated the find_package with version number

Code: Select all

find_packkage(gRPC "1.44.0 (64bit)" CONFIG REQUIRED)

Now, received error as
find_package called with invalid argument "1.44.0 (64bit)"
even if I remove the (64bit) it gives error of not compatilibility.

I tried another way by adding

Code: Select all

include(FetchContent)
FetchContent_Declare(gRPC
GIT_REPOSITORY https://github.com/grpc/grpc)
set(FETCHCONTENT_QUIET OFF)
FetchContent_MakeAvailable(gRPC)
The above code gets grpc from github link and installs in the build folder during the build process. but it gives an error
Could not found pthread library
My questions are
Q 1. Is it possible to compile gRPC and Protobuff for espressif platform as in gRPC repo , I could not find support for espressif platform. https://github.com/grpc/grpc/tree/mast ... -platforms

Q2: If Q1 possible, how to do this? any example code or guidelines available?
Any help would be much appreciated. Thanks.

Who is online

Users browsing this forum: Bing [Bot], stdenits and 309 guests