diff options
| author | Steven Knight <knight@baldmt.com> | 2005-01-10 13:45:00 (GMT) |
|---|---|---|
| committer | Steven Knight <knight@baldmt.com> | 2005-01-10 13:45:00 (GMT) |
| commit | 519037f42eb7c90c5fb1f7d2e2b41ccee5fdba86 (patch) | |
| tree | 44bc33674ae55485c128e0a59a050cbda7a52973 /src/engine/SCons/Script/__init__.py | |
| parent | 69e3c442cdfb846cbcba7702d500e237b66be71e (diff) | |
| download | SCons-519037f42eb7c90c5fb1f7d2e2b41ccee5fdba86.zip SCons-519037f42eb7c90c5fb1f7d2e2b41ccee5fdba86.tar.gz SCons-519037f42eb7c90c5fb1f7d2e2b41ccee5fdba86.tar.bz2 | |
Eliminate Executor's creation and use of a build_dict and a subst_dict, which were creating a separate OverrideEnvironment for every target and foiling the Memoizer's attempts at speeding up things.
Diffstat (limited to 'src/engine/SCons/Script/__init__.py')
| -rw-r--r-- | src/engine/SCons/Script/__init__.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index d6d4912..d94fee2 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -191,7 +191,7 @@ GlobalDefaultEnvironmentFunctions = [ 'BuildDir', 'CacheDir', 'Clean', - 'Command', + #The Command() method is handled separately, below. 'Depends', 'Dir', 'Execute', @@ -245,3 +245,21 @@ GlobalDefaultBuilders = [ for name in GlobalDefaultEnvironmentFunctions + GlobalDefaultBuilders: exec "%s = _SConscript.DefaultEnvironmentCall(%s)" % (name, repr(name)) + +# The global Command() function must be handled differently than the +# global functions for other construction environment methods because +# we want people to be able to use Actions that must expand $TARGET +# and $SOURCE later, when (and if) the Action is invoked to build +# the target(s). We do this with the subst=1 argument, which creates +# a DefaultEnvironmentCall instance that wraps up a normal default +# construction environment that performs variable substitution, not a +# proxy that doesn't. +# +# There's a flaw here, though, because any other $-variables on a command +# line will *also* be expanded, each to a null string, but that should +# only be a problem in the unusual case where someone was passing a '$' +# on a command line and *expected* the $ to get through to the shell +# because they were calling Command() and not env.Command()... This is +# unlikely enough that we're going to leave this as is and cross that +# bridge if someone actually comes to it. +Command = _SConscript.DefaultEnvironmentCall('Command', subst=1) |
