diff options
author | Steven Knight <knight@baldmt.com> | 2004-02-09 06:59:46 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-02-09 06:59:46 (GMT) |
commit | 653ac5db394d13a48068d170b6a294c32768235f (patch) | |
tree | 2179fb29cac6cb7112e1b9b423e6a42ebb6fdd8f /src/engine/SCons/Executor.py | |
parent | beb70fd5da65eb66b2b91df6ed487e4e927b5273 (diff) | |
download | SCons-653ac5db394d13a48068d170b6a294c32768235f.zip SCons-653ac5db394d13a48068d170b6a294c32768235f.tar.gz SCons-653ac5db394d13a48068d170b6a294c32768235f.tar.bz2 |
Save memory by allowing Nodes to clean up their Executor's build environments after they've been built.
Diffstat (limited to 'src/engine/SCons/Executor.py')
-rw-r--r-- | src/engine/SCons/Executor.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/engine/SCons/Executor.py b/src/engine/SCons/Executor.py index 2a0882e..8151f87 100644 --- a/src/engine/SCons/Executor.py +++ b/src/engine/SCons/Executor.py @@ -32,6 +32,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" from SCons.Debug import logInstanceCreation +import SCons.Util class Executor: @@ -71,6 +72,13 @@ class Executor: overrides = {} overrides.update(self.builder.overrides) overrides.update(self.overrides) + try: + generate_build_dict = self.targets[0].generate_build_dict + except AttributeError: + pass + else: + overrides.update(generate_build_dict()) + overrides.update(SCons.Util.subst_dict(self.targets, self.sources)) self.build_env = env.Override(overrides) return self.build_env @@ -101,6 +109,12 @@ class Executor: for action in action_list: func(action, self.targets, self.sources, env) + def cleanup(self): + try: + del self.build_env + except AttributeError: + pass + def add_sources(self, sources): """Add source files to this Executor's list. This is necessary for "multi" Builders that can be called repeatedly to build up |