[cmake-developers] Introduce 'Unix Ninja' generator

Daniel Levin dendy.ua at gmail.com
Thu Jan 15 09:15:00 EST 2015


Brad,

The main problem was in environment when build tool is running from inside
of QNX SDK 'make' or 'sh' commands.
Those tools completely screw up the environment simulating Unix, so Ninja
cannot process generated *.ninja scripts normally anymore.

As soon as *.ninja scripts generated in the same way as on Unix (use
sh.exe, forward slashes, proper escaping, etc) regular Windows Ninja
executable runs normally under that QNX SDK shell.

I did not try Cygwin CMake, but expect it might produce similar output.
Maybe with exceptions to Windows drive letters. I predict that QNX SDK
might conflict with Cygwin environment, but did not check that actually.

I should also note that one of my goals was to keep using standard Windows
shell for both generation and build stages. This allows to continue using
native IDEs. For instance, when I work in QtCreator I simply override
'make' executable with 'ninja' and it keeps working normally.

Thanks,
Daniel

On Thu, Jan 15, 2015 at 8:44 AM, Brad King <brad.king at kitware.com> wrote:

> On 01/14/2015 04:11 AM, Daniel Levin wrote:
> > we need Ninja generator running on Windows with Unix environment.
> [snip]
> > is the only way to use Ninja with QNX toolchain on Windows.
>
> Thanks for working on this.
>
> Each generator corresponds to a specific build tool.  Users should
> select a generator based on the build tool and environment in which
> they want to run, not the toolchain they want to use.  Unless there
> is a separate "ninja" tool for this environment that is distinct
> from the Windows "ninja", this should not need a separate generator.
> From your patch it looks like you're still using a normal ninja tool
> but wrapping all command lines inside 'sh.exe'.
>
> Perhaps the main Ninja generator can be taught how to generate the
> command lines for this toolchain.  Much of your work on the patch
> so far could probably be re-used for this approach.  It may need
> to be integrated differently, though.
>
> Side note: Have you tried running the Cygwin versions of CMake and
> Ninja to drive this toolchain?
>
> -Brad
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150115/497712c2/attachment-0001.html>


More information about the cmake-developers mailing list