[cmake-developers] Ninja windows

Peter Collingbourne peter at pcc.me.uk
Tue Mar 6 13:29:00 EST 2012


n Tue, Mar 06, 2012 at 12:43:29PM -0500, Bill Hoffman wrote:
> On 3/6/2012 12:17 PM, Peter Collingbourne wrote:
>
>> The Ninja generator is disabled on Windows as it still doesn't yet
>> work correctly with Ninja's master branch.  It works to some degree
>> with someone else's branch, but one of the required features on that
>> branch (response file support) was recently merged into Ninja master,
>> so hopefully someone on Windows will be able to add the necessary
>> support to CMake soon.  I would hold off on setting up a dashboard
>> for Windows until we can at least build CMake with Ninja master.
>>
>
> I am a bit confused.   What are the features on someone else's branch  
> that the CMake generator needs?

I think the only missing feature was response file support, but I am
not entirely sure.

> What will it take to get this:
>
>
> http://sourceforge.net/projects/cmakescript/files/cmake-2.8.7.20120202-Ninja.exe 
> 
>
>
> into the CMake source tree?
>
>
> I would be OK, with a non-standard ninja as long as those patches are  
> eventually going to be in ninja.

Well, the way that the branch supports response files is different to
the way that Ninja master supports them (the branch uses some kind of
hack to figure out what the command arguments are and copies those
into a response file, while on master the generator is responsible
for deciding on the contents of the response file using the "rspfile"
variable as documented here [1]).  The branch happens to work without
any modifications to CMake but we will need to add support for rspfile
for things to work on master.

> I don't like having ninja windows  
> cmake support outside of the main cmake dev tree.

All the code is already in ninja-generator in the staging repository,
it just needs to be turned on (i.e. by commenting out the if
statement).

>  Could we do this:
>
> 1. integrate cmake windows ninja support into next
> 2. run a dashboard that uses a given ninja binary?
>
> My goal would be to make sure cmake windows ninja keeps building and  
> working and other ninja work does not break the existing cmake windows  
> support.

We can certainly do that, but the ninja binary would need to be
switched as soon as we get around to using rspfile in Ninja (and
no sooner).

>> I have been asking Windows developers to enable the generator locally
>> for their own development by commenting out the IF(NOT WIN32) block.
>> Perhaps once we set up Windows dashboards it would be better to
>> introduce an internal variable (CMAKE_USE_NINJA?) which can be used
>> to enable this generator on Windows, and have the dashboards use it.
>>
> I would rather have it on by default and print some warning if it finds  
> the "wrong" ninja, one that does not have the required patches.

I don't think it's worth adding detection support for a now-obsolete
version of Ninja, but we can certainly check for rspfile support once
we start using that in CMake.

Thanks,
-- 
Peter

[1] http://martine.github.com/ninja/manual.html#_rule_variables



More information about the cmake-developers mailing list