summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Defaults.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-07-22 11:38:20 (GMT)
committerSteven Knight <knight@baldmt.com>2003-07-22 11:38:20 (GMT)
commit17f8210401fbaf283fba34e5d87700e4e7431470 (patch)
tree85869e6a0a2ff03ee52b9d34052225d9cc580106 /src/engine/SCons/Defaults.py
parent1737bf0b826d00d06a62f623e61404795cc65b49 (diff)
downloadSCons-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.py10
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