[Scons-users] dependencies when you define environment variables

TOM TANNER (BLOOMBERG/ LONDON) ttanner2 at bloomberg.net
Wed Jul 18 09:33:01 EDT 2012


That works with Command builders, but I can't see how to do it if I define a Builder and want to do something like

builder = Builder(action = 'some_program_that_needs_an_environment_variable_set')

especially if the environment variable value depends on the value of $SOURCE

so I end up doing an emitter that records some program as a dependency

----- Original Message -----
From: scons-users at scons.org
To: scons-users at scons.org
At: 7/18 14:27:57

On Wed, Jul 18, 2012 at 3:32 AM, TOM TANNER (BLOOMBERG/ LONDON)
<ttanner2 at bloomberg.net> wrote:


> This is quite an issue in Builders where you can't (or at least I can't find a way of) set variables in env['ENV'] to pass down to the shell


All Builders take construction-env overrides as keyword args at the
end, and all builders use env['ENV'] as the shell env for their
children. So you should be able to do something like this:

e=env[ENV]
e['FOO']='BAR'
env.Command(target, sources, 'mycmd $SOURCES $TARGET', ENV=e)

--
Gary
_______________________________________________
Scons-users mailing list
Scons-users at scons.org
http://four.pairlist.net/mailman/listinfo/scons-users



More information about the Scons-users mailing list