diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2022-02-08 14:32:41 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2022-02-09 10:19:46 +0200 |
commit | 9689e2bafcf9af511df1f357aa3f6ec8545d0010 (patch) | |
tree | 0d7c28e6ec9e900b90302e0b6754306f3701865c /libbuild2/target.hxx | |
parent | 1cccd7acfa672397b7d5d1a759f803bb0f748224 (diff) |
Don't skip empty see-through target groups
Diffstat (limited to 'libbuild2/target.hxx')
-rw-r--r-- | libbuild2/target.hxx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/libbuild2/target.hxx b/libbuild2/target.hxx index 4ce871b..76c01b6 100644 --- a/libbuild2/target.hxx +++ b/libbuild2/target.hxx @@ -1144,10 +1144,19 @@ namespace build2 // See-through group members iteration mode. Ad hoc members must always // be entered explicitly. // + // Note that if the group is empty, then we see the group itself (rather + // than nothing). Failed that, an empty group would never be executed (e.g., + // during clean) since there is no member to trigger the group execution. + // Other than that, it feels like seeing the group in this cases should be + // harmless (i.e., rules are generally prepared to see prerequisites they + // don't recognize). + // enum class members_mode { - always, // Iterate over members, assert if not resolvable. - maybe, // Iterate over members if resolvable, group otherwise. + always, // Iterate over members if not empty, group if empty, assert if + // not resolvable. + maybe, // Iterate over members if resolvable and not empty, group + // otherwise. never // Iterate over group (can still use enter_group()). }; @@ -1200,9 +1209,10 @@ namespace build2 leave_group (); // Iterate over this group's members. Return false if the member - // information is not available. Similar to leave_group(), you should - // increment the iterator after calling this function (provided it - // returned true). + // information is not available (note: return true if the group is + // empty). Similar to leave_group(), you should increment the iterator + // after calling this function provided group() returns true (see + // below). // bool enter_group (); |