flatcc v0.3.5 build dependency support and an experimental meson build

29 views
Skip to first unread message

mikkelfj

unread,
Sep 19, 2016, 2:44:38 AM9/19/16
to FlatBuffers
Flatcc v0.3.5 was just released (FlatBuffers bindings for C)


The new features over 0.3.4 are new command line options and dependency file generation to work closer with build systems in general (including Ninja build and Make).

Notably, flatcc --depfile and -d option can be used to convince the Ninja build system to rebuild if and only if a nested schema file is touched. This, however is an uphill struggle with CMake custom builds where you have to add all schema files manually and hope for the best. Which leads us to:

The Meson Build System http://mesonbuild.com which is like CMake, just friendlier, and which I can actually get work with chains of generated dependencies. However, the main flatcc branch will remain CMake for now so there is this new meson branch for testing out the concept.

Meson is actually more interesting for end users which is why I created a separate sample project based on the issue #4 test case. Here it is possible to clone a minimal project without flatcc installed, and have the test case running in 4 seconds, and build clean in 2 seconds after the initial flatcc clone. See also ReadMe in the sample project listed below.

This works by adding flatcc as a Meson subproject. The client program gets predefined rules to handle dependencies, include paths and code generation.


Please be aware that getting path logic exactly in right can be tricky - a path must match exactly, not just resolve to the same file. For now it is recommended to use absolute paths on input schema and build root relative paths on files relating to generated content. Depending in feedback, flatcc might have to change exactly how it handles relative paths to different options (which is not specific to Meson).

Rebuilding with Ninja and correct dependencies is extemely fast when configured in an editor - see for example Mesonic plugin for Vim and Microsoft VSCode for visual debugging of Ninja built projects cross platform.

mikkelfj

unread,
Sep 19, 2016, 12:05:11 PM9/19/16
to FlatBuffers


On Monday, September 19, 2016 at 8:44:38 AM UTC+2, mikkelfj wrote:
Flatcc v0.3.5 was just released (FlatBuffers bindings for C)

Please upgrade to v0.3.5a, don't use 0.3.5 - I made a regression causing double allocation in the flatcc tool - not affecting generated content, just a crash in final cleanup of the parser.
Reply all
Reply to author
Forward
0 new messages