[cmake-developers] [Ninja] Status and roadmap
Nicolas Desprès
nicolas.despres at gmail.com
Mon Apr 11 19:31:53 EDT 2011
2011/4/11 Brad King <brad.king at kitware.com>:
> 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.
For the moment I'm ignoring these variables. I'll take care of them
after step 5 of the roadmap to have a better overview of how things
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.
>
I hope so. Ninja spawns a /bin/sh -c to execute the command. Also,
IMHO when you reach such a limit you generally better split your
library/executable in smaller libraries because link time becomes
prohibitve. The future will tell us whether it is an issue.
>> - 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.
Attached git log master..ninja-generator and git log -p master..ninja-generator.
The "real" work starts with patches title prefixed by "Ninja:". Before
that it is unrelated little fixes I have done on the way.
Thanks for replying,
--
Nicolas Desprès
-------------- next part --------------
A non-text attachment was scrubbed...
Name: git-log-ninja-generator.txt.bz2
Type: application/x-bzip2
Size: 274316 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20110411/c393e604/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: git-log-p-ninja-generator.txt.bz2
Type: application/x-bzip2
Size: 12708 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20110411/c393e604/attachment-0001.bin>
More information about the cmake-developers
mailing list