aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-03-14 18:09:59 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-03-14 18:09:59 +0200
commite33d019df8dd84cf5b9b078daa643a65b7fde22f (patch)
tree13e90e6e4c72d69c9f720825a089eb21887a1031
parent12a62f4566d4b98aa949f9aec3467eb8359274ad (diff)
Don't add non-existent/non-updatable headers to depdb
-rw-r--r--build2/cxx/compile.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/build2/cxx/compile.cxx b/build2/cxx/compile.cxx
index b15944c..10d80db 100644
--- a/build2/cxx/compile.cxx
+++ b/build2/cxx/compile.cxx
@@ -651,15 +651,6 @@ namespace build2
l6 ([&]{trace << "injecting " << f;});
- // Verify/add it to the dependency database.
- //
- if (!cache)
- {
- string* dl (dd.read ());
- if (dl == nullptr || *dl != f.string ())
- dd.write (f);
- }
-
// Split the name into its directory part, the name part, and
// extension. Here we can assume the name part is a valid filesystem
// name.
@@ -719,6 +710,13 @@ namespace build2
//
bool restart (update (pt, cache ? dd.mtime () : timestamp_unknown));
+ // Verify/add it to the dependency database. We do it after update in
+ // order not to add bogus files (non-existent and without a way to
+ // update).
+ //
+ if (!cache)
+ dd.expect (pt.path ());
+
// Add to our prerequisite target list.
//
t.prerequisite_targets.push_back (&pt);