[CMake] Ninja: a small build system closest in spirit to Make

David Cole david.cole at kitware.com
Fri Feb 11 09:58:20 EST 2011


On Fri, Feb 11, 2011 at 9:17 AM, Matt Williams <lists at milliams.com> wrote:

> On Thursday 10 Feb 2011 14:38:55 Nicolas Desprès wrote:
> > Hi everyone,
> >
> > Probably some of you are already aware of this new open-source project
> > coming from a Chrome developer at Google.
> >
> > Its goal was to improve the build system performance of the Chrome
> > project. So it is designed to be a fast replacement for make.
> >
> > He speaks about it in its blog here:
> >
> > http://neugierig.org/software/chromium/notes/2011/02/ninja.html
> >
> > You can find the source code here:
> >
> > https://github.com/martine/ninja
> >
> > and the manual here:
> >
> > http://martine.github.com/ninja/manual.html
> >
> > As mentioned in the documentation the input file for ninja are not
> > designed to be written by hand and should be generated.  So it
> > perfectly fits in CMake generator approach to build system.
> >
> > Maybe it worth adding a new generator for Ninja in CMake.  I don't
> > know about the maturity/stability of the project, though it is still
> > very young (started in last October but still maintained today
> > according to the git log).  Also, if it is internally used at Google
> > for the Chrome project, I think it is not going to die.
> >
> > I will try to find some time on my spare time to start writing a
> > generator for it.  Helps is welcome too :-)  I would like to see if it
> > really increases build time of project already using CMake, such as
> > boost or KDE.
>
> I would be very interested to see this. I think we all now that in many
> ways
> 'make' is showing its age. Without tools like CMake supporting Ninja it
> will
> have a hard time catching on. I don't really have to time to devote to
> developing the generator but I would be very happy to test it on a number
> of
> CMake projects I'm involved with.
>
> Do we know if Ninja is supposed to be cross-platform (i.e. Windows) as
> well?
>
> Regards,
> Matt
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>


I tried compiling it on Windows yesterday with just the following
CMakeLists.txt file, and there were a bunch of compile errors. It shouldn't
be too hard to make it work on Windows, though, if Mr. Martin will accept
some patches for it... :-)


cmake_minimum_required(VERSION 2.8)
project(ninja)

set(ninja_lib_sources
  src/build.cc
  src/build_log.cc
  src/eval_env.cc
  src/graph.cc
  src/parsers.cc
  src/subprocess.cc
  src/util.cc
  src/ninja_jumble.cc
)
add_library(ninjaLib STATIC ${ninja_lib_sources})

add_executable(ninja src/ninja.cc)
target_link_libraries(ninja ninjaLib)


Cheers,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110211/c3fefb8f/attachment.htm>


More information about the CMake mailing list