Page 1 of 1

Compiling gRPC C++ for esp-idf

Posted: Fri Jul 01, 2022 10:33 am
by mmmunir966
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.