I didn't think about just writing a .cmd (or .bat?) with cmake, that sounds
like the simplest solution!
After each each custom command we just need to add something like this to
have the same behaviour as the &&:

if %errorlevel% neq 0 exit /b %errorlevel%

I have no experience with cmake implementation though, how would you find a
name for the filename?

Martin

On Thu, May 19, 2016 at 4:03 PM Brad King <brad.k...@kitware.com> wrote:

> 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
>
> --
Martin
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to