aboutsummaryrefslogtreecommitdiff
path: root/build2/cxx/compile.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-03-16 16:21:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-03-16 16:21:07 +0200
commit7f9fda79a0e96bbeeaee4e6b05f9ae5e1738d88a (patch)
tree7a5594759f62f9136db32845fd4baf7268805d7a /build2/cxx/compile.cxx
parentc76ff457079bf5901a6bb55377c14aeee856a354 (diff)
Change prerequisite cleaning "limit" from subdirectories to same project
One day we will get this right.
Diffstat (limited to 'build2/cxx/compile.cxx')
-rw-r--r--build2/cxx/compile.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/build2/cxx/compile.cxx b/build2/cxx/compile.cxx
index b07019d..df2b798 100644
--- a/build2/cxx/compile.cxx
+++ b/build2/cxx/compile.cxx
@@ -81,8 +81,10 @@ namespace build2
// code (below) takes care of the ones it is adding.
//
// When cleaning, ignore prerequisites that are not in the same
- // or a subdirectory of ours.
+ // or a subdirectory of our project root.
//
+ scope& rs (t.root_scope ());
+
link::search_paths_cache lib_paths; // Extract lazily.
for (prerequisite_member p: group_prerequisite_members (a, t))
@@ -115,7 +117,7 @@ namespace build2
target& pt (p.search ());
- if (a.operation () == clean_id && !pt.dir.sub (t.dir))
+ if (a.operation () == clean_id && !pt.dir.sub (rs.out_path ()))
continue;
build2::match (a, pt);
@@ -128,7 +130,6 @@ namespace build2
//
if (a == perform_update_id)
{
- scope& rs (t.root_scope ());
const string& sys (as<string> (*rs["cxx.target.system"]));
// The cached prerequisite target should be the same as what is in