CMake generates bad command with ninja using rsp files
CMake (3.6.1 and 3.7.0) have generated a rules file which contains a error in one of our linker rules using Ninja (v 1.7.2).
The following generated command (from rules.ninja) is the BAD example (fails):
rule CXX_STATIC_LIBRARY_LINKER__MyLib
command = cmd.exe /C "$PRE_LINK && C:\ARM\ARMCT_5.0x\bin\armar.exe --create -cr $TARGET_FILE $LINK_FLAGS @$RSP_FILE && $POST_BUILD"
description = Linking CXX static library $TARGET_FILE
rspfile = $RSP_FILE
rspfile_content = $in_newline $LINK_PATH $LINK_LIBRARIES
restat = $RESTAT
The following generated but modifyed command (from rules.ninja) is the GOOD example (works):
rule CXX_STATIC_LIBRARY_LINKER__MyLib
command = cmd.exe /C "$PRE_LINK && C:\ARM\ARMCT_5.0x\bin\armar.exe --create -cr $TARGET_FILE $LINK_FLAGS $RSP_FILE && $POST_BUILD"
description = Linking CXX static library $TARGET_FILE
rspfile = $RSP_FILE
rspfile_content = $in_newline $LINK_PATH $LINK_LIBRARIES
restat = $RESTAT
You can see that the bad example contains an '@' in the 'command' where the RSP_FILE is specifyed. This will fail the armar.exe because it can not resolve the bad path. Removing the '@' will solve the problem.
This Bug is a Blocker.