[cmake-developers] Custom commands with Ninja on Windows

Brad King brad.king at kitware.com
Thu May 19 10:03:02 EDT 2016


On 05/19/2016 01:43 AM, Martin Ankerl wrote:
> It seems to me that there are two possible solution:
> 
> * use a response file (rspfile and rspfile_content).

Can cmd.exe /C even use a response file?  Perhaps the whole command could
simply be written to a .cmd file instead.  I don't think our generated
custom commands ever use ninja placeholders so we could have CMake write
the commands to a file instead.  Ninja would only see a call to that file.
The drawback is that we may not see the whole command from `ninja -v`.

> only possible when modifying ninja to support multiline response files

In what case do we end up with a multiline command?  Isn't it just
one long command line with && chaining?

> * Add a build target for each custom command, e.g. instead of

It may be tricky to get the same build semantics with that approach.

Thanks,
-Brad



More information about the cmake-developers mailing list