From f1c981a22365411794806ed0744b857ef0804e35 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 24 Jun 2022 10:29:09 +0200 Subject: Allow ad hoc rules not to list targets that are updated during match For example, this allows a Qt moc rule not to list generated headers from libQtCore since they are pre-generated by the library. --- libbuild2/cc/link-rule.cxx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'libbuild2/cc/link-rule.cxx') diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx index 0081fe2..d0a1f4a 100644 --- a/libbuild2/cc/link-rule.cxx +++ b/libbuild2/cc/link-rule.cxx @@ -1003,7 +1003,7 @@ namespace build2 if (*um) { pto.target = &p.search (t); // mark 0 - pto.include |= 2; + pto.include |= prerequisite_target::include_udm; update_match = true; } } @@ -1144,7 +1144,7 @@ namespace build2 if (const libx* l = pt->is_a ()) { pt = link_member (*l, a, li); - pto.include |= 4; + pto.include |= include_group; } } else @@ -1231,7 +1231,7 @@ namespace build2 << "not supported by this rule"; m = 0; - pto.include |= 2; + pto.include |= prerequisite_target::include_udm; update_match = true; } } @@ -1245,10 +1245,14 @@ namespace build2 // of the libraries (for example, if generation requires some of the // metadata; think poptions needed by Qt moc). // - match_members (a, t, pts, start, {2 /* mask */, 0 /* value */}); + { + auto mask (prerequisite_target::include_udm); - if (update_match) - match_members (a, t, pts, start, {2, 2}); + match_members (a, t, pts, start, {mask, 0}); + + if (update_match) + match_members (a, t, pts, start, {mask, mask}); + } // Check if we have any binful utility libraries. // @@ -1383,7 +1387,7 @@ namespace build2 // prerequisite_target::data. // if (update_match) - update_during_match_prerequisites (trace, a, t, 2 /* mask */); + update_during_match_prerequisites (trace, a, t); // Now that we know for sure whether we are binless, derive file name(s) // and add ad hoc group members. Note that for binless we still need the -- cgit v1.1