[Scons-users] [Parts]: How to modify the default environment
Pico Geyer
picogeyer at gmail.com
Tue Aug 29 12:25:28 EDT 2017
Hi Jason,
Should I be cc'ing the scons mailing list with Parts questions?
I've been exploring Parts for a little while and it seems very useful
for a big project like ours.
It does many of the things we've been trying to do but in a far more
structured manner.
I have a silly question.
How do I influence the default environment?
Before moving over to Parts, we'd just set a variable in the top level
environment and pass it down into all the SConscript files.
Now with parts:
### SConstruct ###
from parts import *
env = Environment()
env['BUILD_NUMBER'] = 1234
#How do I make Part use the environment
Part('mypart', 'mypart.parts')
### mypart.parts ###
Import('*')
#Expecting environment to contain BUILD_NUMBER
print(env['BUILD_NUMBER])
Regards,
Pico
More information about the Scons-users
mailing list