From ded8aa661b013f325aaab7267cf6cc811d6d94cb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 24 Oct 2023 09:56:22 +0200 Subject: Undo "Don't install static library prerequisites of executable" This turned out not to be always correct since a static library can have prerequisites that it requires at runtime (see the libca-certificates-curl for an example). The new plan is to split static/shared library installation into run-time and build-time parts using the new match options mechanism. --- libbuild2/cc/install-rule.cxx | 24 ------------------------ libbuild2/cc/install-rule.hxx | 3 +-- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/libbuild2/cc/install-rule.cxx b/libbuild2/cc/install-rule.cxx index b13a7eb..3eaaa94 100644 --- a/libbuild2/cc/install-rule.cxx +++ b/libbuild2/cc/install-rule.cxx @@ -38,20 +38,11 @@ namespace build2 // Less obvious: we also want to install a static library prerequisite // of a library (since it could be referenced from its .pc file, etc). // - // This is also the place were we make sure we don't install static - // library prerequisites of an executable (we cannot do it later, where - // we handle headers, because we may need to resolve the member). - // However, there is a nuance: we still have to update such static - // libraries in order to signal that they are being built for install. - // // Note: for now we assume these prerequisites never come from see- // through groups. // // Note: we install ad hoc prerequisites by default. // - if (a.operation () != update_id && t.is_a () && p.is_a ()) - return nullptr; - otype ot (link_type (t).type); // Note: at least one must be true since we only register this rule for @@ -71,14 +62,8 @@ namespace build2 // link. For libu*{} we want the "see through" logic. // if (const libx* l = pt->is_a ()) - { pt = link_member (*l, a, link_info (t.base_scope (), ot)); - if (a.operation () != update_id && - t.is_a () && pt->is_a ()) - return nullptr; - } - // Note: not redundant since we are returning a member. // if ((st && pt->is_a ()) || (at && pt->is_a ())) @@ -332,9 +317,6 @@ namespace build2 // above. In particular, here we use libue/libua/libus{} as proxies for // exe/liba/libs{} there. // - if (a.operation () != update_id && t.is_a () && p.is_a ()) - return nullptr; - otype ot (link_type (t).type); bool st (t.is_a () || t.is_a ()); // Target needs shared. @@ -347,14 +329,8 @@ namespace build2 const target* pt (&search (t, p)); if (const libx* l = pt->is_a ()) - { pt = link_member (*l, a, link_info (t.base_scope (), ot)); - if (a.operation () != update_id && - t.is_a () && pt->is_a ()) - return nullptr; - } - if ((st && pt->is_a ()) || (at && pt->is_a ())) return is == nullptr || pt->in (*is) ? pt : nullptr; diff --git a/libbuild2/cc/install-rule.hxx b/libbuild2/cc/install-rule.hxx index 5039309..6998d63 100644 --- a/libbuild2/cc/install-rule.hxx +++ b/libbuild2/cc/install-rule.hxx @@ -24,8 +24,7 @@ namespace build2 // // 1. Signal to the link rule that this is update for install. // - // 2. Custom filtering of prerequisites (e.g., headers and static - // libraries of an exe{}). + // 2. Custom filtering of prerequisites (e.g., headers of an exe{}). // // 3. Extra un/installation (e.g., libs{} symlinks). // -- cgit v1.1