Ninja: command line response file check for linker uses encoded size for arguments
Discussed in http://cmake.3232098.n2.nabble.com/No-RSP-FILE-if-generating-in-a-path-that-contains-quot-quot-tc7597671.html
If Ninja generator detects certain characters in arguments, it encodes the arguments (normally files), using variables like $identNN. In my case EncodeIdent() encoded '@' (and IsIdentChar() would encode '%','=' etc) which should not be necessary, but that is a separate minor issue. If encoding, the generated files should be handled.
WriteBuild() will encode the filename arguments. The length check in the same function will check if the size of encoded parameters are shorter than 8192 bytes (CMD limitation in Windows), not the expanded size that CMD will see. Commands with expanded length of maybe 8K to 30K will therefore not work. Shorter or longer argument lists will work fine.
The workaround should be to patch Ninja to use RSP_FILE anyway. Other workarounds are broken, see the mailing list.
cmGlobalNinjaGenerator.cxx:: if (cmdLineLimit < 0 || (cmdLineLimit > 0 && (arguments.size() + buildstr.size() + assignments.size() + 1000) > static_cast<size_t>(cmdLineLimit))) {