https://github.com/bewaremypower/protobuf-demo
Google protocol buffer demos
https://github.com/bewaremypower/protobuf-demo
cpp protocol-buffers
Last synced: 11 days ago
JSON representation
Google protocol buffer demos
- Host: GitHub
- URL: https://github.com/bewaremypower/protobuf-demo
- Owner: BewareMyPower
- Created: 2021-07-14T09:43:23.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-01-04T03:53:49.000Z (over 4 years ago)
- Last Synced: 2025-01-14T00:22:35.850Z (over 1 year ago)
- Topics: cpp, protocol-buffers
- Language: CMake
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# protobuf-demo
Examples to use [protobuf](https://github.com/protocolbuffers/protobuf).
## Install dependencies
It's recommended to use [vcpkg](https://github.com/microsoft/vcpkg) to install dependencies.
Take MacOS 64-bit as example, you need to run:
```bash
vcpkg install --feature-flags=manifests --triplet x64-osx
```
Choose the correct triplet for your OS, see [here](https://github.com/microsoft/vcpkg/tree/master/triplets) for all available triplets.
## Build examples
If you have installed dependencies using vcpkg, you can simply run:
```bash
cmake -B ./build -DVCPKG_TRIPLET=x64-osx
cmake --build ./build
```
Then all executables will be generated under `build/` directory.
On MacOS, you can also run the wrapped scripts:
```bash
./scripts/configure-osx.sh
./scripts/build-osx.sh
```
> **NOTE**
>
> You must ensure the `VCPKG_TRIPLET` is the correct triplet for your OS. If you don't use vcpkg to install dependencies, you will need to specify `-DCMAKE_PREFIX_PATH` or ensure your dependencies are installed in system path.
## Code format
If `clang-format` is installed, the code will be formatted automatically using `clang-format`.
You can also run following command to format the code manually.
```bash
cmake --build ./build --target format
```