[CMake] FYI - From Ninja-build mailing list - Fwd: Proposal: restat rules

Peter Collingbourne peter at pcc.me.uk
Sun Sep 11 22:55:16 EDT 2011


On Fri, Sep 09, 2011 at 02:55:00PM +0000, Malfettone, Kris wrote:
> Peter,
> I am very interested in the ninja generator and gave it a try for one of my very large projects.  Unfortunately, I have approximately 100 targets all with the same output name(simple) but in CMake I give them all unique target names(dot separated name built from their place in the directory tree).  This works fine for Makefiles however the ninja generator seems to be adding:
>         # Shortcut target for the output name.
>         build simple: phony MD/MDF/Parsers/BX/BLS/v1_1/utils/simple/simple
>         # Shortcut target for the target name.
>         build BX.BLS.v1_1.simple: phony simple
> Which then causes the following from ninja:
>         ninja: WARNING: multiple rules generate simple. build will not be correct; continuing anyway
> 
> Is there a way to disable these shortcut targets?  Even changing my target names to a different format is a possibility if that is necessary.

Not currently.  There are a few other projects I am aware of that
do something similar.  I will probably modify the generator to not
output shortcut targets for a given basename if more than one target
has that basename.

Thanks,
-- 
Peter


More information about the CMake mailing list