[cmake-developers] [Ninja] Status and roadmap

Brad King brad.king at kitware.com
Mon Apr 11 17:47:13 EDT 2011


On 04/11/2011 05:16 AM, Nicolas Desprès wrote:
> I have continued my work on the Ninja generator this weekend and I

Great!  Thanks for working on this.

> 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.

Looks good.

> 6/ Generate the 'clean' target.
> 7/ Generate the 'install' target.

The 'install' target should be pretty easy.  In all generators it is
just a simple rule (depending on 'all') that runs

  cmake -P cmake_install.cmake

with perhaps an extra -D option to indicate which configuration to
install.  As long as the generator obeys all the rules about where
to put files in the build tree (e.g. CMAKE_RUNTIME_OUTPUT_DIRECTORY)
then the install scripts should work.

> 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.

Sounds good.  The per-target generator design used by the Makefile
generators and the VS 10 generator has proven to be the easiest to
maintain.

> - 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.

If you can get it to work this way, great!

> - 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.

You are correct.  The link.txt is really just an implementation detail
to work around command line length limits in Makefile rules.  You do
not need it if Ninja natively supports long lines.

> - 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.

I'm not sure if I'll have time to do a detailed review, I am interested
in seeing the patch series.

Thanks,
-Brad



More information about the cmake-developers mailing list