CMake Ninja generator preprocesses Fortran
CMake with the Ninja and Ninja Multi-Config generators virtually always work well together, including with Fortran projects. To generate the dependency graph, CMake directs the Fortran compiler to preprocess each Fortran code file when using the Ninja generator. In rare cases, some legacy Fortran large code files can generate unexpected and spurious syntax errors when using CMake + Ninja.
The workaround seems to be to use the GNU Make backend, we have found that works for the rare case this became an issue.