[cmake-developers] ninja bug

Nicolas Desprès nicolas.despres at gmail.com
Mon Apr 23 10:53:53 EDT 2012


On Mon, Apr 23, 2012 at 3:52 PM, Bill Hoffman <bill.hoffman at kitware.com> wrote:
> On 4/21/2012 7:37 AM, Peter Kümmel wrote:
>>
>>
>> Great! Is this the step which will be dropped when the /fast target is
>> build?
>>
>>
>> Peter
>
> No, that drops building all the dependent targets.
>
>
> So, would it be possible to use CMake's depend generation with ninja? Right
> now ninja creates the .d files as part of the compilation.  Is it possible
> to move that to a separate pass?  Is it possible to have a per target .d
> file?
>
> This is actually important for Fortran support, which right now is totally
> broken in ninja.  For Fortran, you have to parse all the files first to find
> out what order they need to be compiled in.  So, doing it on the compile
> line is too late.
>

Bill,

A short answer, because it is topic that will require more work in the
generator and I have to think more about it. I don't think it is
trivial.

The depfile attribute for a rule is not mandatory. So, yes I think it
is possible to use the CMake's depend generation with Ninja as a
fallback. Actually, that was one of the question I had in mind when I
started to work on this generator. When Peter picked up the torch, he
went straight to the "usual" depfile as it is done in Ninja itself.
For the per target .d file, I think it is possible too. It is close
the request to have .s and .i target for each built files.

I add that to my todo list but it is growing faster than I removed
items. Spare time...

Maybe Peter has an idea about how to implement this quickly.

Cheers,

-- 
Nicolas Desprès



More information about the cmake-developers mailing list