diff options
-rw-r--r-- | libbuild2/target.hxx | 3 | ||||
-rw-r--r-- | libbuild2/target.ixx | 18 | ||||
-rw-r--r-- | libbuild2/target.txx | 2 |
3 files changed, 21 insertions, 2 deletions
diff --git a/libbuild2/target.hxx b/libbuild2/target.hxx index 5870be4..e91c41a 100644 --- a/libbuild2/target.hxx +++ b/libbuild2/target.hxx @@ -1194,6 +1194,9 @@ namespace build2 void switch_mode (); + group_view + resolve_members (const prerequisite&); + private: const prerequisite_members_range* r_; base_iterator i_; diff --git a/libbuild2/target.ixx b/libbuild2/target.ixx index dd377b0..f304250 100644 --- a/libbuild2/target.ixx +++ b/libbuild2/target.ixx @@ -339,6 +339,22 @@ namespace build2 resolve_members (action, const target&); // <libbuild2/algorithm.hxx> template <typename T> + inline group_view prerequisite_members_range<T>::iterator:: + resolve_members (const prerequisite& p) + { + // We want to allow iteration over members during execute provided the + // same iteration has been performed during match. + // + const target* pt (r_->t_.ctx.phase == run_phase::match + ? &search (r_->t_, p) + : search_existing (p)); + + assert (pt != nullptr); + + return build2::resolve_members (r_->a_, *pt); + } + + template <typename T> inline auto prerequisite_members_range<T>::iterator:: operator++ () -> iterator& { @@ -383,7 +399,7 @@ namespace build2 { // Otherwise assume it is a normal group. // - g_ = resolve_members (r_->a_, search (r_->t_, *i_)); + g_ = resolve_members (*i_); if (g_.members == nullptr) // Members are not know. { diff --git a/libbuild2/target.txx b/libbuild2/target.txx index 17c38c8..280d179 100644 --- a/libbuild2/target.txx +++ b/libbuild2/target.txx @@ -20,7 +20,7 @@ namespace build2 // do { - g_ = resolve_members (r_->a_, search (r_->t_, *i_)); + g_ = resolve_members (*i_); // Group could not be resolved. // |