Installation¶
This page covers installing the schema compilers and generating language bindings from the schemas.
Prerequisites¶
You need at least one of the three schema compilers installed. Install only the ones you plan to use.
Cap'n Proto¶
FlatBuffers¶
Protocol Buffers¶
Generating code¶
Clone the repository and use the Makefile:
git clone https://github.com/tipatterson-dev/SWECommonBinaryEncodings.git
cd SWECommonBinaryEncodings
Build all three at once:
Or build individually:
make capnproto # → gen/capnproto/
make flatbuffers # → gen/flatbuffers/
make protobuf # → gen/protobuf/
Generated code is written to gen/<format>/.
Choosing a target language¶
The Makefile defaults to C++. Override with variables:
# Cap'n Proto — Java
make capnproto CAPNP_LANG=java
# FlatBuffers — Python
make flatbuffers FLATC_LANG=python
# Protocol Buffers — Go
make protobuf PROTO_LANG=go
Direct compiler invocation¶
If you prefer not to use the Makefile: