[Scons-users] exporting environment to SConscript

Eric Smith eric at brouhaha.com
Wed Jun 20 23:25:35 EDT 2012


In my SConstruct I have different environments for building different
sorts of targets (native vs. cross, 32-bit vs. 64-bit, debug vs. release).

I use separate build directories for all of those, but using the same
source directory. I use Sconscript like this:

SConscript (dirs = ['src'],
variant_dir = 'build-32',
duplicate = 0,
exports = ['env'])

Is there some way to export a specific env such as env_linux_32_debug,
but such that it winds up just being 'env' in a particular invocation of
the SConscript, then later export a different env such as
env_windows_64_release into a different invocation?

Right now the only way I've found to do that is to do a clone like:
env = env_windows_64_release.Clone ()
before each invocation of SConscript, but maybe there is a more elegant
approach?

Thanks!
Eric



More information about the Scons-users mailing list