Is there an API to know gRPC/protobuf version or the git commit hash? We would like to include these in --version
information of our C++ application.
The files gRPC-Core.podspec
, gRPC-C++.podspec
, Protobuf-C++.podspec
etc. do have this information; wonder if the same can be extracted without having to parse these files.
gRPC exposes the version in its API:
const GRPCAPI char* grpc_version_string ( void )
For the C++ implementation there appears to be the following method in the <grpcpp/grpcpp.h>
header:
For protobuf the macro GOOGLE_PROTOBUF_VERSION
is the integer value of its version & can be converted to string using the following API:
std::string google::protobuf::internal::VersionString(int version)