aboutsummaryrefslogtreecommitdiff
path: root/build2/cxx/link.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-02-14 15:17:56 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-02-14 15:17:56 +0200
commit568aab7f19cc9bbb42c7fb4afef541a79459d657 (patch)
treedb9324f02442bb82fadfc14da7f57feded9deab0 /build2/cxx/link.cxx
parent4e665067ff264c55086fdfb776a95b0fbb4d432c (diff)
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.
Diffstat (limited to 'build2/cxx/link.cxx')
-rw-r--r--build2/cxx/link.cxx13
1 files changed, 4 insertions, 9 deletions
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