[cmake-developers] new ninja rebuild too much issue

Peter Collingbourne peter at pcc.me.uk
Wed Mar 14 13:10:30 EDT 2012


On Wed, Mar 14, 2012 at 10:45:39AM -0400, Bill Hoffman wrote:
> On 3/14/2012 7:34 AM, Nicolas Desprès wrote:
>> Nope if you like in the generated build.ninja "build.ninja" appears
>> only once as an output using the RERUN_CMAKE rule.
>>
>> I rather think it is a bug in ninja of the restat implementation.
> What is the way to debug this?  Can you get ninja to tell you why it is  
> choosing to do a build of a file?  This is quite reproducible.

Most likely, this is due to the compile command line changing between
runs.  If any command line changes, Ninja will need to re-run that
command.  In particular, toggling CMAKE_ENABLE_NINJA would affect
whether CMAKE_USE_NINJA is defined on the command line for anything
under Source.  Ninja stores previously run commands in .ninja_log so
you can examine that to verify that the command line is changing.

We can probably reduce the amount of recompilation required by only
defining CMAKE_ENABLE_NINJA for cmake.cxx (the only source file that
uses it).

Thanks,
-- 
Peter



More information about the cmake-developers mailing list