- Fix --implicit-cache causing redundant rebuilds when the header
file list changed.
+ - Fix --implicit-cache when a file has no implicit dependencies and
+ its source is generated.
+
From Zed Shaw:
- Add an Append() method to Environments, to append values to
return '%s %s %s %s' % (timestamp, bsig, csig, implicit)
def get_implicit(self):
- if self.implicit is None:
+ if not self.implicit:
return None
else:
return string.split(self.implicit, '\0')
def set_implicit(self, implicit):
- if implicit is None:
+ if not implicit:
self.implicit = None
else:
self.implicit = string.join(map(str, implicit), '\0')
include = Dir('include')
env = Environment(CPPPATH=['inc2', include])
SConscript('variant/SConscript', "env")
+
+def copy(target, source, env):
+ open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read())
+nodep = env.Command('nodeps.c', 'nodeps.in', action=copy)
+env.Program('nodeps', 'nodeps.c')
""")
test.write(['subdir', 'SConscript'],
env.Program(target='prog', source='prog.c')
""")
+test.write('nodeps.in',
+r"""
+int
+main(int argc, char *argv[])
+{
+ argv[argc++] = "--";
+ return 0;
+}
+""")
+
+
test.write(['include', 'foo.h'],
r"""
#define FOO_STRING "include/foo.h 1\n"
test.run(program = test.workpath(variant_prog),
stdout = "subdir/prog.c\ninclude/foo.h 3\ninclude/bar.h 1\n")
+# test in the face of a file with no dependencies where the source file is generated:
+test.run(arguments = "--implicit-cache nodeps%s"%_exe)
+
+
test.pass_test()