[cmake-developers] Custom Ninja deptypes

Ben Boeckel mathstuf at gmail.com
Mon Mar 24 13:28:57 EDT 2014


Hi,

I just pushed dev/custom-ninja-deptypes to the stage. It allows a
toolchain to specify an alternate deptype for Ninja by setting the
variable CMAKE_NINJA_DEPTYPE_<LANG>. It is done after the custom MSVC
check since it requires other logic besides just changing the 'deps'
Ninja rule variable.

This is to preempt support for new depenency file formats upstream may
support (I have the 'ldc' type as a pull request[1] currently).

Since D is similar to Fortran (AFAIK) in the way that dependencies are
handled (an object file for a single TU depends on many source files the
compiler is best suited to determine at build time), this may be a way
to get Fortran dependencies in Ninja as well. Looking at gfortran, it
supports the -M depfile flags as of 4.6, so Ninja fortran support may
just be a version check away (for gfortran at least). Other fortran
compilers could get a depfile format supported in Ninja if they're
something different.

--Ben

[1]https://github.com/martine/ninja/pull/721


More information about the cmake-developers mailing list