From e33d019df8dd84cf5b9b078daa643a65b7fde22f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 14 Mar 2016 18:09:59 +0200 Subject: Don't add non-existent/non-updatable headers to depdb --- build2/cxx/compile.cxx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'build2/cxx/compile.cxx') 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); -- cgit v1.1