summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-07-14 18:48:56 (GMT)
committerSteven Knight <knight@baldmt.com>2002-07-14 18:48:56 (GMT)
commit64abe288f007db6a36ed2bb5d018fde707a243de (patch)
treeb45029d74b471fafd7757bceeb29a8c6ae5f73c3
parent4a6f158a8f3589b43fcda1c5ca50b743661a87f2 (diff)
downloadSCons-64abe288f007db6a36ed2bb5d018fde707a243de.zip
SCons-64abe288f007db6a36ed2bb5d018fde707a243de.tar.gz
SCons-64abe288f007db6a36ed2bb5d018fde707a243de.tar.bz2
Add --implicit-deps-changed. (Anthony Roach)
-rw-r--r--doc/man/scons.16
-rw-r--r--src/CHANGES.txt2
-rw-r--r--src/engine/SCons/Node/__init__.py6
-rw-r--r--src/engine/SCons/Script/__init__.py9
-rw-r--r--test/option--implicit-cache.py31
5 files changed, 52 insertions, 2 deletions
diff --git a/doc/man/scons.1 b/doc/man/scons.1
index 8761335..d32b7ff 100644
--- a/doc/man/scons.1
+++ b/doc/man/scons.1
@@ -400,6 +400,12 @@ dependency is added earlier in the implicit dependency search path
(e.g. CPPPATH) than a current implicit dependency with the same name.
.TP
+--implicit-deps-changed
+Force SCons to ignore the cached implicit dependencies. This causes the
+implicit dependencies to be rescanned and recached. This implies
+.BR --implicit-cache .
+
+.TP
--implicit-deps-unchanged
Force SCons to ignore changes in the implicit dependencies.
This causes cached implicit dependencies to always be used.
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 6b0c79c..cb26c91 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -135,7 +135,7 @@ RELEASE 0.08 -
suffix computation, code cleanup in MultiStepBuilder.__call__(),
and replicating some logic in scons_subst().
- - Add a --implicit-deps-unchanged option.
+ - Add --implicit-deps-changed and --implicit-deps-unchanged options.
- Add a GetLaunchDir() function.
diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py
index bc0539e..90cd122 100644
--- a/src/engine/SCons/Node/__init__.py
+++ b/src/engine/SCons/Node/__init__.py
@@ -60,6 +60,10 @@ implicit_cache = 0
# controls whether implicit dep changes are ignored:
implicit_deps_unchanged = 0
+# controls whether the cached implicit deps are ignored:
+implicit_deps_changed = 0
+
+
class Node:
"""The base Node class, for entities that we know how to
build, or use to build other Nodes.
@@ -200,7 +204,7 @@ class Node:
if not self.builder:
return
- if implicit_cache:
+ if implicit_cache and not implicit_deps_changed:
implicit = self.get_stored_implicit()
if implicit is not None:
implicit = map(self.builder.source_factory, implicit)
diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py
index 1d53fed..66b4fd7 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_changed(opt, arg):
+ import SCons.Node
+ SCons.Node.implicit_cache = 1
+ SCons.Node.implicit_deps_changed = 1
+
+ Option(func = opt_implicit_deps_changed,
+ long = ['implicit-deps-changed'],
+ help = "Ignore the cached implicit deps.")
+
def opt_implicit_deps_unchanged(opt, arg):
import SCons.Node
SCons.Node.implicit_cache = 1
diff --git a/test/option--implicit-cache.py b/test/option--implicit-cache.py
index d6ca15c..4e5cf1e 100644
--- a/test/option--implicit-cache.py
+++ b/test/option--implicit-cache.py
@@ -297,4 +297,35 @@ assert string.find(test.stdout(), 'is up to date') != -1, test.stdout()
test.run(arguments = variant_prog)
assert string.find(test.stdout(), 'is up to date') == -1, test.stdout()
+# Test forcing rescanning:
+test.write(['include', 'foo.h'],
+r"""
+#define FOO_STRING "include/foo.h 3\n"
+#include "bar.h"
+""")
+
+test.run(arguments = "--implicit-cache " + args)
+
+test.write(['include', 'foo.h'],
+r"""
+#define FOO_STRING "include/foo.h 3\n"
+#include "baz.h"
+#include "bar.h"
+""")
+
+test.run(arguments = "--implicit-deps-unchanged " + variant_prog)
+assert string.find(test.stdout(), 'is up to date') == -1, test.stdout()
+
+test.write(['include', 'baz.h'],
+r"""
+#define BAZ_STRING "include/baz.h 2\n"
+""")
+
+test.run(arguments = "--implicit-deps-unchanged " + variant_prog)
+assert string.find(test.stdout(), 'is up to date') != -1, test.stdout()
+
+test.run(arguments = "--implicit-deps-changed " + variant_prog)
+assert string.find(test.stdout(), 'is up to date') == -1, test.stdout()
+
+
test.pass_test()