~fsx/protobluff

9f4a0c1e44b5b9fc5642d9e791680ca1e50640d8 — Frank Smit 11 months ago 10730ca
Update README (WIP).
1 files changed, 20 insertions(+), 25 deletions(-)

M README.md
M README.md => README.md +20 -25
@@ 38,23 38,22 @@ allocations.

### Building from source

protobluff is built using [Autotools][] and can be linked as a static or shared
protobluff is built using [Meson][] and can be linked as a static or shared
library. It has no runtime dependencies and is fully self-contained, except for
the code generator which depends on the original Protocol Buffers library and
is necessary to generate bindings from `.proto` schema files. If the original
library is not available, the generator is not built. The following commands
build and install the protobluff library and code generator:

``` sh
./autogen.sh &&
./configure &&
make &&
make test &&
make install
```sh
meson setup ./build -Doptimization=3 -Dstrip=true -Ddebug=false
meson compile -C ./build
meson test -C ./build
meson install -C ./build
```

protobluff should compile and run on all UNIX systems (including Linux and Mac
OS) as it adheres to the C99 and C++98 standards and does not make use of any
OS) as it adheres to the C99 and C++17 standards and does not make use of any
system-specific functionality.

After installing protobluff, the code generator can be used to generate


@@ 74,16 73,23 @@ remove all symbols that are not defined in the public header files, allowing
further optimizations. Enabling the coverage report is only necessary to
determine unit test coverage, and thus only needed during development.

``` sh
./configure
  --disable-optimized # No optimizations (default: enabled)
  --enable-stripped   # Strip internal symbols (default: disabled)
  --enable-coverage   # Coverage report (default: disabled)
```sh
meson setup ./build/ -Db_coverage=true -Doptimization=0 -Dstrip=false
meson compile -C ./build coverage-html
```

FIXME: Coverage is broken.

The tests can only be built if stripped compilation is not enabled, as no
internal symbols would be visible to the unit tests.

Or run tests with Valgrind:

```sh
meson test --wrap='valgrind --dsymutil=yes --tool=memcheck --track-origins=yes --leak-check=full --show-reachable=yes --suppressions=valgrind.supp' -C build/
```


## Using the code generator

The code generator is tightly integrated with the protoc compiler toolchain


@@ 179,17 185,6 @@ pkg-config --cflags protobluff # Add output to compiler flags
pkg-config --libs   protobluff # Add output to linker flags
```

### Autotools

If you're using Autotools, the `PKG_CHECK_MODULES` macro will take care of the
heavy lifting. Adding the following line to your `configure.ac` file will place
the compiler flags into the variable `protobluff_CFLAGS` and the linker flags
into the variable `protobluff_LDFLAGS`:

``` makefile
PKG_CHECK_MODULES([protobluff], [protobluff])
```

## Features

### Already supported


@@ 240,6 235,6 @@ IN THE SOFTWARE.

[Protocol Buffers]: https://developers.google.com/protocol-buffers/docs/overview
[Protocol Buffers Encoding Guide]: https://developers.google.com/protocol-buffers/docs/encoding
[Autotools]: http://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html
[Meson]: https://mesonbuild.com/
[Valgrind]: http://valgrind.org/
[LCOV]: http://ltp.sourceforge.net/coverage/lcov.php