--
You received this message because you are subscribed to the Google Groups "ninja-build" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ninja-build...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nico, thanks for pointing on workarounds.1. POSIX only, would be good to have portable solution.2. On Windows that will not work. The trick is we want per process specific environment. There are tools which accept some parameters ONLY via environment variables.
Earlier discussion:
https://groups.google.com/forum/#!topic/ninja-build/J8UIXu7S5pQ
We probably oughta put this in the Ninja docs somewhere.
On Sun, Aug 9, 2015 at 11:21 PM, Daniel Levin <dend...@gmail.com> wrote:
> Okay, msvc tool is visible only on Windows after updating to 1.6. But I
> still can't understand how to get help for specific tool usage.
ninja -t msvc -h
> And what
> should be format of env.file.
The entries are separated by \0:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682653(v=vs.85).aspx
I think you can also use "cmd" as your command executor to set variables:
http://superuser.com/questions/223104/setting-environment-variable-for-just-one-command-in-windows-cmd-exe
(This is more or less what Ninja does on non-Windows, as all commands
are executed within a shell.)
Also, to your original request -- I seem to recall we used to support
environment variables more directly in some way, but then maybe
removed that? Scott probably recalls the reasoning better than I do.
I was compelled to use wrappers for a while and can tell now that it is very painful way. Every single tool that might accept environment variable must be wrapped. Every possible variable must be copied into wrapper, taking in account potential clashes with tool arguments, proper extracting variables from those arguments, avoid overriding some variables you don't want to for particular command, etc. When you have multiple projects you need to duplicate wrappers everywhere and fix all your build scripts. Multiply this by incompatible Windows and Unix shells you need to write your wrappers for.
Sorry I cannot understand your examples of handling environment variables, how the suppose to specify variable for particular command? Example from Scott above is something I have in my mind.
--