diff options
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/Tool/ToolTests.py | 3 | ||||
-rw-r--r-- | src/engine/SCons/Tool/__init__.py | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/engine/SCons/Tool/ToolTests.py b/src/engine/SCons/Tool/ToolTests.py index c53ada3..cd809df 100644 --- a/src/engine/SCons/Tool/ToolTests.py +++ b/src/engine/SCons/Tool/ToolTests.py @@ -39,6 +39,8 @@ class ToolTestCase(unittest.TestCase): if not SCons.Util.is_List(progs): progs = [ progs ] return progs[0] + def Append(self, **kw): + self.dict.update(kw) def __getitem__(self, key): return self.dict[key] def __setitem__(self, key, val): @@ -52,6 +54,7 @@ class ToolTestCase(unittest.TestCase): assert (env['CXX'] == 'c++' or env['CXX'] == 'g++'), env['CXX'] assert env['CXXFLAGS'] == '$CCFLAGS', env['CXXFLAGS'] assert env['INCPREFIX'] == '-I', env['INCPREFIX'] + assert env['TOOLS'] == ['g++'], env['TOOLS'] try: SCons.Tool.Tool() diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index 908101e..7cf9b29 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -48,6 +48,10 @@ class ToolSpec: def __init__(self, name): self.name = name + def __call__(self, env, *args, **kw): + env.Append(TOOLS = [ self.name ]) + apply(self.generate, ( env, ) + args, kw) + def __str__(self): return self.name @@ -66,7 +70,7 @@ def Tool(name): if file: file.close() spec = ToolSpec(name) - spec.__call__ = sys.modules[full_name].generate + spec.generate = sys.modules[full_name].generate spec.exists = sys.modules[full_name].exists return spec |