Ninja: re-compilation cascades in Fortran builds
When cmake uses the "Unix Makefiles" generator it produces a makefile that contains some additional "magic" to avoid unnecessary re-compilations. Basically, when a Fortran module is re-compiled, cmake checks, does the produced *.mod
file differ from the *.mod
file from previous compilation, and is able to figure out that modules are actually the same.
Contrary, when cmake uses the "Ninja" generator such optimization isn't applied and if Fortran compiler updates timestamps of module files on each re-compilation, even if the *.mod
file itself wasn't changed (as in case of ifort), an incremental build with ninja falls in a series of unnecessary re-compilations.