aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-10-24 09:56:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-11-01 10:28:43 +0200
commitded8aa661b013f325aaab7267cf6cc811d6d94cb (patch)
treefd1814dd61e2a17d0aa40c87ac4741eb104701f3
parentc5d8a9cf5137c3272cab4981eeff97c16304de95 (diff)
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.
-rw-r--r--libbuild2/cc/install-rule.cxx24
-rw-r--r--libbuild2/cc/install-rule.hxx3
2 files changed, 1 insertions, 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<exe> () && p.is_a<liba> ())
- 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<libx> ())
- {
pt = link_member (*l, a, link_info (t.base_scope (), ot));
- if (a.operation () != update_id &&
- t.is_a<exe> () && pt->is_a<liba> ())
- return nullptr;
- }
-
// Note: not redundant since we are returning a member.
//
if ((st && pt->is_a<libs> ()) || (at && pt->is_a<liba> ()))
@@ -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<libue> () && p.is_a<liba> ())
- return nullptr;
-
otype ot (link_type (t).type);
bool st (t.is_a<libue> () || t.is_a<libus> ()); // Target needs shared.
@@ -347,14 +329,8 @@ namespace build2
const target* pt (&search (t, p));
if (const libx* l = pt->is_a<libx> ())
- {
pt = link_member (*l, a, link_info (t.base_scope (), ot));
- if (a.operation () != update_id &&
- t.is_a<libue> () && pt->is_a<liba> ())
- return nullptr;
- }
-
if ((st && pt->is_a<libs> ()) || (at && pt->is_a<liba> ()))
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).
//