diff options
author | Steven Knight <knight@baldmt.com> | 2004-04-14 13:09:11 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-04-14 13:09:11 (GMT) |
commit | 73f9a42aaa603934e51ffb10bc256e9a3c17cd9b (patch) | |
tree | 9fc71cff3cdd7238433923ca761f8d74a8ce23d9 /src/engine/SCons/Environment.py | |
parent | e4adb76f832acf1d22f99801a54abb9ea1562182 (diff) | |
download | SCons-73f9a42aaa603934e51ffb10bc256e9a3c17cd9b.zip SCons-73f9a42aaa603934e51ffb10bc256e9a3c17cd9b.tar.gz SCons-73f9a42aaa603934e51ffb10bc256e9a3c17cd9b.tar.bz2 |
Fix custom scanner behavior when setting/copying/replacing the SCANNERS construction variable.
Diffstat (limited to 'src/engine/SCons/Environment.py')
-rw-r--r-- | src/engine/SCons/Environment.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index 2144a7f..c312f31 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -300,6 +300,9 @@ class Base: except KeyError: self._dict[key] = BuilderDict(kwbd, self) self._dict[key].update(value) + elif key == 'SCANNERS': + self._dict[key] = value + self.scanner_map_delete() else: if not SCons.Util.is_valid_construction_var(key): raise SCons.Errors.UserError, "Illegal construction variable `%s'" % key @@ -407,6 +410,19 @@ class Base: except KeyError: return None + def scanner_map_delete(self, kw=None): + """Delete the cached scanner map (if we need to). + """ + if not kw is None: + try: + kw['SCANNERS'] + except KeyError: + return + try: + del self.scanner_map + except AttributeError: + pass + def subst(self, string, raw=0, target=None, source=None, dict=None, conv=None): """Recursively interpolates construction variables from the Environment into the specified string, returning the expanded @@ -546,6 +562,7 @@ class Base: # value to it (if there's a value to append). if val: add_to_orig(val) + self.scanner_map_delete(kw) def AppendENVPath(self, name, newpath, envname = 'ENV', sep = os.pathsep): """Append path elements to the path 'name' in the 'ENV' @@ -590,6 +607,7 @@ class Base: self._dict[key] = dk + val else: self._dict[key] = self._dict[key] + val + self.scanner_map_delete(kw) def Copy(self, tools=None, toolpath=[], **kw): """Return a copy of a construction Environment. The @@ -779,6 +797,7 @@ class Base: if orig: add_to_val(orig) self._dict[key] = val + self.scanner_map_delete(kw) def PrependENVPath(self, name, newpath, envname = 'ENV', sep = os.pathsep): """Prepend path elements to the path 'name' in the 'ENV' @@ -823,6 +842,7 @@ class Base: self._dict[key] = val + dk else: self._dict[key] = val + dk + self.scanner_map_delete(kw) def Replace(self, **kw): """Replace existing construction variables in an Environment @@ -836,6 +856,7 @@ class Base: pass kw = copy_non_reserved_keywords(kw) self._dict.update(our_deepcopy(kw)) + self.scanner_map_delete(kw) def ReplaceIxes(self, path, old_prefix, old_suffix, new_prefix, new_suffix): """ |