MantisBT - CMake
View Issue Details
0015295CMakeCMakepublic2014-12-09 05:302016-06-10 14:31
Ilya 
Kitware Robot 
highmajoralways
closedmoved 
Windows
 
 
0015295: Ninja: CMake should not concatenate commands for cmd.exe
Commands like add_custom_target allows to specify many COMMAND parameters. On windows it concatenates all values into one big command and then passes to cmd.exe

Unfortunately cmd.exe has limit of the length of a command that can be passed: 8192.

Therefore CMake should not attempt to concatenate but pass commands to cmd.exe one by one.
No tags attached.
Issue History
2014-12-09 05:30IlyaNew Issue
2014-12-09 08:13Brad KingNote Added: 0037423
2014-12-09 12:34IlyaNote Added: 0037427
2014-12-09 15:16Brad KingNote Added: 0037429
2014-12-09 15:16Brad KingStatusnew => acknowledged
2014-12-09 15:16Brad KingSummaryCMake should not concatenate commands for cmd.exe => Ninja: CMake should not concatenate commands for cmd.exe
2016-06-10 14:29Kitware RobotNote Added: 0042683
2016-06-10 14:29Kitware RobotStatusacknowledged => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0037423)
Brad King   
2014-12-09 08:13   
Which generator are you using?
(0037427)
Ilya   
2014-12-09 12:34   
Ninja
(0037429)
Brad King   
2014-12-09 15:16   
It looks like the current implementation is in cmLocalNinjaGenerator::BuildCommandLine:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmLocalNinjaGenerator.cxx;hb=v3.0.2#l316 [^]

The semantics CMake defines for multiple commands is that each will be run only if the preceding ones succeeded. That is what the "&&" chain does now. Any refactoring will need to preserve that.
(0042683)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.