Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/faaxm/exmpl-cmake-grpc
Example cmake project for grpc / protobuf
https://github.com/faaxm/exmpl-cmake-grpc
cmake cpp grpc protobuf
Last synced: about 2 months ago
JSON representation
Example cmake project for grpc / protobuf
- Host: GitHub
- URL: https://github.com/faaxm/exmpl-cmake-grpc
- Owner: faaxm
- License: mit
- Created: 2020-02-24T14:42:29.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-08-18T23:11:47.000Z (over 1 year ago)
- Last Synced: 2024-05-01T19:28:38.533Z (9 months ago)
- Topics: cmake, cpp, grpc, protobuf
- Language: C++
- Homepage:
- Size: 13.7 KB
- Stars: 93
- Watchers: 3
- Forks: 28
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README
[![Build and Test - Fixed Dependencies](https://github.com/faaxm/exmpl-cmake-grpc/actions/workflows/build.yml/badge.svg)](https://github.com/faaxm/exmpl-cmake-grpc/actions/workflows/build.yml)
[![Build and Test - Latest Dependencies](https://github.com/faaxm/exmpl-cmake-grpc/actions/workflows/build-latest-deps.yml/badge.svg)](https://github.com/faaxm/exmpl-cmake-grpc/actions/workflows/build-latest-deps.yml) (might indicate a bug in dependencies)
# Protobuf/GRPC with CMake Example
This is a basic example of a CMake project using Protobuf together with gRPC in C++.
For some background info, have a look at this blog post explaining [how to structure gRPC projects with CMake](https://www.f-ax.de/dev/2020/11/08/grpc-plugin-cmake-support.html).
### gRPC Reflection
Reflection can be enabled by linking agains `gRPC::grpc++_reflection`, enabling support for the `grpc_cli` tool.If this project is linked with a static version of the grpc library from vcpkg
the `-Wl,--whole-archive` flag has to be used. (together with `--allow-multiple-definition`). When linking dynamically,
you will want to link the reflection library with `--no-as-needed`.