From ee0456ed4a5f3f6686fbb0a433161d1f9d8535fe Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 4 Jul 2019 07:30:23 +0200 Subject: Remove libu{} target group The semantics provided by libu{} is rarely required and as result was not yet documented. However, if you are using it, the new way to achieve the same result is to use both libue{} and libul{} explicitly, for example: exe{foo}: libue{foo} lib{foo}: libul{foo} {libue libul}{foo}: cxx{*} --- build2/cc/link-rule.cxx | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'build2/cc/link-rule.cxx') diff --git a/build2/cc/link-rule.cxx b/build2/cc/link-rule.cxx index 6dfcfa9..9caac51 100644 --- a/build2/cc/link-rule.cxx +++ b/build2/cc/link-rule.cxx @@ -108,9 +108,7 @@ namespace build2 r.seen_obj = r.seen_obj || true; } - else if (p.is_a () || - p.is_a () || - p.is_a ()) + else if (p.is_a () || p.is_a ()) { // For a unility library we look at its prerequisites, recursively. // Since these checks are not exactly light-weight, only do them if @@ -136,7 +134,7 @@ namespace build2 const target* pg (nullptr); const target* pt (p.search_existing ()); - if (p.is_a ()) + if (p.is_a ()) { if (pt != nullptr) { @@ -145,7 +143,7 @@ namespace build2 // considering the group's prerequisites. // if (const target* pm = - link_member (pt->as (), + link_member (pt->as (), a, linfo {ot, lorder::a /* unused */}, true /* existing */)) @@ -170,13 +168,11 @@ namespace build2 pt = search_existing (p.prerequisite.key (tt)); } } - else + else if (!p.is_a ()) { // See if we also/instead have a group. // - // @@ Why are we picking libu{} over libul{} (and below)? - // - pg = search_existing (p.prerequisite.key (libu::static_type)); + pg = search_existing (p.prerequisite.key (libul::static_type)); if (pt == nullptr) swap (pt, pg); @@ -187,7 +183,7 @@ namespace build2 // If we are matching a target, use the original output type // since that would be the member that we pick. // - otype pot (pt->is_a () ? ot : link_type (*pt).type); + otype pot (pt->is_a () ? ot : link_type (*pt).type); match_result pr (match (a, *pt, pg, pot, true /* lib */)); // Do we need to propagate any other seen_* values? Hm, that @@ -229,21 +225,20 @@ namespace build2 ltype lt (link_type (t)); - // If this is a library, link-up to our group (this is the target group - // protocol which means this can be done whether we match or not). + // If this is a group member library, link-up to our group (this is the + // target group protocol which means this can be done whether we match + // or not). // // If we are called for the outer operation (see install rules), then // use resolve_group() to delegate to inner. // - if (lt.library ()) + if (lt.member_library ()) { if (a.outer ()) resolve_group (a, t); else if (t.group == nullptr) t.group = &search (t, - // @@ Why are we picking libu{} over libul{} (and above)? - // - lt.utility ? libu::static_type : lib::static_type, + lt.utility ? libul::static_type : lib::static_type, t.dir, t.out, t.name); } @@ -447,9 +442,7 @@ namespace build2 // If this is the libu*{} group, then pick the appropriate member. // - const libx* ul; - if ((ul = pt->is_a ()) || - (ul = pt->is_a ())) + if (const libul* ul = pt->is_a ()) { pf = &link_member (*ul, a, li)->as (); } -- cgit v1.1