[cmake-developers] ninja bug on windows

Peter Collingbourne peter at pcc.me.uk
Wed Mar 14 11:43:53 EDT 2012


On Wed, Mar 14, 2012 at 10:52:22AM -0400, Bill Hoffman wrote:
> On 3/13/2012 10:39 PM, Peter Collingbourne wrote:
>> Maybe another time we can think about ways to improve PCH support,
>> but for now I guess we can add an OR Ninja to this test and add
>> OBJECT_OUTPUTS support to the Ninja generator.
> I tried making that blog active for ninja and a I get a new error:
>
>
> 122: ninja: ERROR: 'PCH\foo_precompiled.pch', needed by  
> 'CMakeFiles\foo.dir\foo1.c.obj', missing and no known rule to make it
>
>
> So, Ninja is not handling OBJECT_OUTPUTS and OBJECT_DEPENDS correctly?
>
>
>   SET_SOURCE_FILES_PROPERTIES(foo_precompile.c PROPERTIES
>     OBJECT_OUTPUTS "${PCH_DIR}/foo_precompiled.pch")
>
>   # These source files use the precompiled header.
>   SET_SOURCE_FILES_PROPERTIES(${foo_SRCS} PROPERTIES
>     OBJECT_DEPENDS "${PCH_DIR}/foo_precompiled.pch")

The Ninja generator is handling OBJECT_DEPENDS correctly but not
OBJECT_OUTPUTS.  Adding support shouldn't be too difficult -- we
just need to output a phony build statement creating a dependency
from any OBJECT_OUTPUTS to the object file.

Thanks,
-- 
Peter



More information about the cmake-developers mailing list