[Scons-users] Combining SCons with Ninja

Remko Tronçon remko at el-tramo.be
Wed Aug 7 15:12:41 EDT 2013


Hi all,

In case someone's interested: I created a script to use Ninja (a very fast
build tool) with a SCons-based build system. We are currently using this
for our day-to-day development, giving us very fast modify/build/test
cycles (it brings a no-op build down from 7 seconds to about 0.06 seconds
for us).

The way it works is that it bootstraps by doing a SCons dry-run build, and
then parses the output commands (and dependency tree), and generates Ninja
rules for it. For the commands it doesn't have commands for (e.g. python
code), it invokes SCons to generate the files.

Of course, regeneration of the Ninja file is a lot slower than just running
an incremental SCons build, but this rarely happens in a day anyway. The
major other caveat is that it requires full knowledge of all tools used in
the build system (as it needs to parse the command line to determine inputs
and outputs), so the script may not work out of the box for a different
project.

You can find more about it here: http://el-tramo.be/blog/scons2ninja/

As a final remark: the script requires you to do a small change to your
SConscript file, which could be avoided if SCons had a '-B' command-line
flag (such as the one from 'make') which treats all files as out-of-date.
However, this isn't blocking us.

cheers,
Remko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20130807/7389be24/attachment.html


More information about the Scons-users mailing list