[cmake-developers] [Ninja] Status and roadmap

Nicolas Desprès nicolas.despres at gmail.com
Mon Apr 11 05:16:32 EDT 2011


Hi,

I have continued my work on the Ninja generator this weekend and I
have now something able to configure and build a basic helloworld
program.  I also have a 'all' target.  I have sent a pull request to
Ninja on github to support a kind of 'help' target so Ninja can handle
it itself and the generator does not have to generate one.  I have
started to work on a 'clean' target implemented the same way the
UnixMakefile generator does (using a cmake_clean.cmake script) but I
have stashed it for the moment.  I have rather started to work on
building a basic helloworld program with a shared library this time.

Here my roadmap:
1/ Configure and build an helloworld program with a shared library.
2/ Configure and build an helloworld program with a static library.
3/ Configure and build an helloworld program with a configured header.
4/ Configure and build an helloworld program with a custom target.
5/ Configure and build an helloworld program with a custom command.
6/ Generate the 'clean' target.
7/ Generate the 'install' target.
8/ Handle dependency scanning using the special 'depfile' rule
attribute of Ninja.
9/ Get CMake built using Ninja on Linux. I will see later for MacOSX
and Windows support.
10/ Refactor common code with the UnixMakefile generator.

Here some design choices:
- I try to generate "generic" Ninja rules using Ninja variables, so
that I can use Ninja's variable scoping to overload compilation flags
on a per target/source file basis.  This also reduces the number of
Ninja rules generated.  Using the $in and $out Ninja's special
variables also simply the generation process.
- The link rules do not use a link.txt file and cmake -E
cmake_link_script.  I thought its goal was to handle long command
line, but apparently it does not since the command line in the
link.txt file is not split.  Did I miss a point in this implementation
detail and should I rely on a link.txt file? Note that it would make
the implementation more complex since I could not use $in and $out
Ninja's special variables.
- Some code are picked-up from the UnixMakefile generator.  I will see
later how to refactor it.

My code is still in a local branch and backup on another computer.  If
some one is interested in the code I can send the patches (they are
rebased regulary on master).  Though it is a bit too soon since only
the very basics are implemented so far.

Cheers,

-- 
Nicolas Desprès



More information about the cmake-developers mailing list