[cmake-developers] [PATCH 3/3] Add the Ninja generator

Peter Collingbourne peter at pcc.me.uk
Tue Nov 22 14:37:12 EST 2011


On Mon, Nov 14, 2011 at 08:18:16AM +0100, Rolf Eike Beer wrote:
> > diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
> > index 8d6f5df..bdcaf9d 100644
> > --- a/Modules/Compiler/GNU.cmake
> > +++ b/Modules/Compiler/GNU.cmake
> > @@ -24,6 +24,15 @@ macro(__compiler_gnu lang)
> >    set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
> >    set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
> > 
> > +  # Older versions of gcc (< 4.5) contain a bug causing them to report a
> > missing +  # header file as a warning if depfiles are enabled, causing
> > check_header_file +  # tests to always succeed.  Work around this by
> > disabling dependency tracking +  # in try_compile mode.
> > +  GET_PROPERTY(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE)
> > +  if(NOT _IN_TC OR CMAKE_FORCE_DEPFILES)
> > +    set(CMAKE_DEPFILE_FLAGS_${lang} "-MMD -MF <DEPFILE>")
> > +  endif()
> > +
> >    # Initial configuration flags.
> >    set(CMAKE_${lang}_FLAGS_INIT "")
> >    set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-g")
> 
> This may only affect Ninja, but it looks like a general bug. Shouldn't this be 
> it's own commit then?

The Ninja generator is the only user of CMAKE_DEPFILE_FLAGS_${lang}
variables.  I will add this in its own commit to make it clear that
these variables can also be used by other generators.

Thanks,
-- 
Peter



More information about the cmake-developers mailing list