Fortran dyndep command line too long on Windows
The new cmake ninja Fortran support works very well for our project on Linux. We are using cmake-3.7.2 and ninja-1.7.2.git.kitware.dyndep-1.
Tests to use this on Windows (Windows 7 Enterprise) fail with an error message
ninja: fatal: CreateProcess: The filename or extension is too long.
Which is caused by the Fortran_DYNDEP__xxx rule
rule Fortran_DYNDEP__xxx command = E:\users\cmake-3.7\bin\cmake.exe -E cmake_ninja_dyndep --tdi=xxx.dir\FortranDependInfo.json --dd=$out $in description = Generating Fortran dyndep file $out
for a huge directory structure with many (about 1100) Fortran sources we'd like to compile into one library. The resulting command length is about 92000 characters. I tried to use a response file for this command:
rule Fortran_DYNDEP__xxx command = E:\users\cmake-3.7\bin\cmake.exe -E cmake_ninja_dyndep --tdi=xxx.dir\FortranDependInfo.json --dd=$out @$out.rsp description = Generating Fortran dyndep file $out rspfile = $out.rsp rspfile_content = $in
Which fails because it looks like cmake does not support response files:
CMake Error: -E cmake_ninja_dyndep unknown argument: @xxx.dir\Fortran.dd.rsp
So a solution might be to add response file support to cmake and use it in the Ninja generator on Windows. I'm not sure if response file support for cmake might break anything else or if it has this already with different syntax? If you aggree I might try to create a patch for this.