aboutsummaryrefslogtreecommitdiff
path: root/build2/algorithm.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/algorithm.cxx')
-rw-r--r--build2/algorithm.cxx23
1 files changed, 21 insertions, 2 deletions
diff --git a/build2/algorithm.cxx b/build2/algorithm.cxx
index 17768e3..02f3b8e 100644
--- a/build2/algorithm.cxx
+++ b/build2/algorithm.cxx
@@ -502,9 +502,28 @@ namespace build2
: target_state::unchanged);
if (r == target_state::changed && ef.empty ())
- {
ef = move (f);
- }
+
+ er |= r;
+ }
+
+ // Now clean the ad hoc group file members, if any.
+ //
+ for (target* m (ft.member); m != nullptr; m = m->member)
+ {
+ file* fm (dynamic_cast<file*> (m));
+
+ if (fm == nullptr || fm->path ().empty ())
+ continue;
+
+ const path& f (fm->path ());
+
+ target_state r (rmfile (f, false)
+ ? target_state::changed
+ : target_state::unchanged);
+
+ if (r == target_state::changed && ef.empty ())
+ ef = f;
er |= r;
}