From 568aab7f19cc9bbb42c7fb4afef541a79459d657 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 14 Feb 2016 15:17:56 +0200 Subject: Revert back to only cleaning targets in subdirectories Cleaning everything as long as it is in the same strong amalgamation had some undesirable side effects. For example, in bpkg, upgrading a package (which requires clean/reconfigure) led to all its prerequisite being cleaned as well and then rebuilt. That was very surprising. --- build2/cxx/link.cxx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'build2/cxx/link.cxx') diff --git a/build2/cxx/link.cxx b/build2/cxx/link.cxx index 42b2235..3b5b857 100644 --- a/build2/cxx/link.cxx +++ b/build2/cxx/link.cxx @@ -545,13 +545,8 @@ namespace build2 // files as well as search and match. // // When cleaning, ignore prerequisites that are not in the same - // or a subdirectory of our strong amalgamation. + // or a subdirectory of ours. // - const dir_path* amlg ( - a.operation () != clean_id - ? nullptr - : &t.strong_scope ().out_path ()); - for (prerequisite_member p: group_prerequisite_members (a, t)) { bool group (!p.prerequisite.belongs (t)); // Group's prerequisite. @@ -569,7 +564,7 @@ namespace build2 if (pt == nullptr) pt = &p.search (); - if (a.operation () == clean_id && !pt->dir.sub (*amlg)) + if (a.operation () == clean_id && !pt->dir.sub (t.dir)) continue; // Skip. // If this is the obj{} or lib{} target group, then pick the @@ -631,9 +626,9 @@ namespace build2 target& ot (search (o_type, d, *cp.tk.name, nullptr, cp.scope)); // If we are cleaning, check that this target is in the same or - // a subdirectory of our strong amalgamation. + // a subdirectory of ours. // - if (a.operation () == clean_id && !ot.dir.sub (*amlg)) + if (a.operation () == clean_id && !ot.dir.sub (t.dir)) { // If we shouldn't clean obj{}, then it is fair to assume // we shouldn't clean cxx{} either (generated source will -- cgit v1.1