diff options
author | Steven Knight <knight@baldmt.com> | 2002-07-12 06:17:59 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-07-12 06:17:59 (GMT) |
commit | 721c0b5439329cce1a68d44c0e58204a83d9d354 (patch) | |
tree | 640ad8f81638eaf79461675d47418643fbb2e6b1 /src/engine | |
parent | 25846c09acbebca4f41664a76dfc6175b3617e90 (diff) | |
download | SCons-721c0b5439329cce1a68d44c0e58204a83d9d354.zip SCons-721c0b5439329cce1a68d44c0e58204a83d9d354.tar.gz SCons-721c0b5439329cce1a68d44c0e58204a83d9d354.tar.bz2 |
Added --implicit-deps-unchanged option. Added GetLaunchDir() function. Added SetBuildSignatureType() function. (Anthony Roach)
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/Node/__init__.py | 5 | ||||
-rw-r--r-- | src/engine/SCons/Script/SConscript.py | 15 | ||||
-rw-r--r-- | src/engine/SCons/Script/__init__.py | 9 | ||||
-rw-r--r-- | src/engine/SCons/Sig/__init__.py | 13 |
4 files changed, 38 insertions, 4 deletions
diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index 1e23198..bc0539e 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -57,6 +57,9 @@ stack = 6 # nodes that are in the current Taskmaster execution stack # controls whether implicit depedencies are cached: implicit_cache = 0 +# controls whether implicit dep changes are ignored: +implicit_deps_unchanged = 0 + class Node: """The base Node class, for entities that we know how to build, or use to build other Nodes. @@ -203,7 +206,7 @@ class Node: implicit = map(self.builder.source_factory, implicit) self._add_child(self.implicit, implicit) calc = SCons.Sig.default_calc - if calc.current(self, calc.bsig(self)): + if implicit_deps_unchanged or calc.current(self, calc.bsig(self)): return else: # one of this node's sources has changed, so diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py index 0f65732..48c4046 100644 --- a/src/engine/SCons/Script/SConscript.py +++ b/src/engine/SCons/Script/SConscript.py @@ -39,6 +39,7 @@ import SCons.Node.FS import SCons.Platform import SCons.Tool import SCons.Util +import SCons.Sig import os import os.path @@ -48,6 +49,7 @@ import sys default_targets = [] print_help = 0 arguments = {} +launch_dir = os.path.abspath(os.curdir) # global exports set by Export(): global_exports = {} @@ -243,6 +245,17 @@ def Import(*vars): except KeyError,x: raise SCons.Errors.UserError, "Import of non-existant variable '%s'"%x +def GetLaunchDir(): + return launch_dir + +def SetBuildSignatureType(type): + if type == 'build': + SCons.Sig.build_signature = 1 + elif type == 'content': + SCons.Sig.build_signature = 0 + else: + raise SCons.Errors.UserError, "Unknown build signature type '%s'"%type + def BuildDefaultGlobals(): """ Create a dictionary containing all the default globals for @@ -281,4 +294,6 @@ def BuildDefaultGlobals(): globals['Split'] = SCons.Util.Split globals['Tool'] = SCons.Tool.Tool globals['WhereIs'] = SCons.Util.WhereIs + globals['GetLaunchDir'] = GetLaunchDir + globals['SetBuildSignatureType'] = SetBuildSignatureType return globals diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index 6f87353..1d53fed 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -550,6 +550,15 @@ def options_init(): long = ['implicit-cache'], help = "Cache implicit dependencies") + def opt_implicit_deps_unchanged(opt, arg): + import SCons.Node + SCons.Node.implicit_cache = 1 + SCons.Node.implicit_deps_unchanged = 1 + + Option(func = opt_implicit_deps_unchanged, + long = ['implicit-deps-unchanged'], + help = "Ignore changes in implicit deps.") + def opt_j(opt, arg): global num_jobs try: diff --git a/src/engine/SCons/Sig/__init__.py b/src/engine/SCons/Sig/__init__.py index 553c9ce..0e629fb 100644 --- a/src/engine/SCons/Sig/__init__.py +++ b/src/engine/SCons/Sig/__init__.py @@ -38,6 +38,10 @@ import time #XXX Get rid of the global array so this becomes re-entrant. sig_files = [] +# 1 means use build signature for derived source files +# 0 means use content signature for derived source files +build_signature = 1 + def write(): global sig_files for sig_file in sig_files: @@ -359,13 +363,13 @@ class Calculator: def get_signature(self, node): """ - Get the appropriate signature for a node. + Get the appropriate build signature for a node. node - the node returns - the signature or None if the signature could not be computed. - This method does not store the signature in the node and + This method does not store the signature in the node or in the .sconsign file. """ @@ -374,7 +378,10 @@ class Calculator: # directory) so bail right away. return None elif node.builder: - return self.bsig(node) + if build_signature: + return self.bsig(node) + else: + return self.csig(node) elif not node.exists(): return None else: |