diff options
author | Steven Knight <knight@baldmt.com> | 2003-07-22 11:38:20 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-07-22 11:38:20 (GMT) |
commit | 17f8210401fbaf283fba34e5d87700e4e7431470 (patch) | |
tree | 85869e6a0a2ff03ee52b9d34052225d9cc580106 /src/engine/SCons/Defaults.py | |
parent | 1737bf0b826d00d06a62f623e61404795cc65b49 (diff) | |
download | SCons-17f8210401fbaf283fba34e5d87700e4e7431470.zip SCons-17f8210401fbaf283fba34e5d87700e4e7431470.tar.gz SCons-17f8210401fbaf283fba34e5d87700e4e7431470.tar.bz2 |
Only create a default Environment when asked to. (Chad Austin)
Diffstat (limited to 'src/engine/SCons/Defaults.py')
-rw-r--r-- | src/engine/SCons/Defaults.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py index e2bb3b4..aa0fbd9 100644 --- a/src/engine/SCons/Defaults.py +++ b/src/engine/SCons/Defaults.py @@ -44,6 +44,7 @@ import string import SCons.Action import SCons.Builder +import SCons.Environment import SCons.Node.Alias import SCons.Node.FS import SCons.Scanner.C @@ -56,6 +57,15 @@ import SCons.Scanner.Prog # interface. _default_env = None +# Lazily instantiate the default environment so the overhead of creating +# it doesn't apply when it's not needed. +def DefaultEnvironment(): + global _default_env + if not _default_env: + _default_env = SCons.Environment.Environment() + return _default_env + + def alias_builder(env, target, source): pass |