[cmake-developers] [PATCH 0/3] The CMake Ninja generator.

Peter Collingbourne peter at pcc.me.uk
Fri Nov 11 21:36:04 EST 2011


Hi,

These patches add the Ninja generator to CMake, which I am now
proposing for inclusion in mainline.  The generator should work
with the current 'master' branch of Ninja from:

https://github.com/martine/ninja

The generator passes the CMake test suite on Linux (Debian testing)
and FreeBSD 9.0-RC1, and I have been regularly using it myself with
LLVM and Clang for about 2 months.  I have also successfully tested it
with the build systems for OpenCV, Bullet Physics, BRL-CAD, kdelibs
and Path64.

Some performance numbers for no-op builds (2.0GHz dual core laptop,
Debian testing):

CMake:
Unix Makefiles: 0.6s
Ninja:          0.042s

kdelibs:
Unix Makefiles: 9.8s
Ninja:          2.5s [1]

LLVM/Clang/Polly:
Unix Makefiles: 2.9s
Ninja:          0.18s

BRL-CAD:
Unix Makefiles: 19s
Ninja:          0.40s

Path64:
Unix Makefiles: 3.9s
Ninja:          0.25s

Note that this generator is *nix only (it relies on POSIX shell
functionality), and will only be built on *nix platforms.  I am not
interested in Windows support, but I understand that others have
expressed an interest in adding support.

I made some minor changes to the ExternalProject module as well as
some of the tests to make them work with the generator, and added
explanations for those changes as comments.

I separated out the changes to kwsys, so that they can be applied
separately.

This patch series is also available from my git repository:
git://github.com/pcc/CMake.git ninja-generator-pr

Please review!

Thanks,
-- 
Peter

[1] The disproportionately large Ninja run time here seems to be
    caused by a large number of required invocations of the 'automoc'
    command.




More information about the cmake-developers mailing list