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.
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.
# 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.
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)
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
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()