luncliff / grpc-worknote

personal experiments with grpc(v1.25+) for C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

References

How To

Build

Simply run with the CMake. Its version must be 3.14 or later.

cmake_minimum_required(VERSION 3.14)

VcPkg

The project requires VcPkg. Expects 2019.08 release or later

$ vcpkg install --triplet x64-windows grpc catch2 ms-gsl

After the installation, run CMake with the CMAKE_TOOLCHAIN_FILE.

$ cd /code/build
$ cmake .. -DCMAKE_TOOLCHAIN_FILE="/vcpkg/scripts/buildsystem/vcpkg.cmake"
$ cmake --build . --config debug

Code generation for gRPC

There are several CMake targets to support code generations. Each can be used like the following

$ cd /code/build
$ cmake --build . --target generate_grpc_files_cpp

Current codegen target list:

  • codegen_cpp
  • codegen_python
  • codegen_nodejs
  • codegen_csharp
  • codegen_go

Especially, Go requires additional setup to acquire code generator.

export GOPATH=$(pwd)
go get github.com/golang/protobuf/protoc-gen-go

Or, for PowerShell,

$env:GOPATH=Get-Location
go get github.com/golang/protobuf/protoc-gen-go

By doing this, 'bin/' folder will contain 'protoc-gen-go' executable.

Test

CTest is enabled

TBA

About

personal experiments with grpc(v1.25+) for C++


Languages

Language:C++ 59.7%Language:CMake 29.7%Language:Python 10.6%