From 462afa615e9f2fdff12a0ee7a36eb431ee07e141 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 18 Nov 2024 09:43:39 +0200 Subject: Drop some disabled code that is unlikely to be needed --- libbuild2/cc/install-rule.cxx | 132 ------------------------------------------ 1 file changed, 132 deletions(-) (limited to 'libbuild2') diff --git a/libbuild2/cc/install-rule.cxx b/libbuild2/cc/install-rule.cxx index 6758e03..3fede89 100644 --- a/libbuild2/cc/install-rule.cxx +++ b/libbuild2/cc/install-rule.cxx @@ -76,86 +76,6 @@ namespace build2 otype ot (link_type (t).type); - // @@ TMP: drop eventually. - // -#if 0 - // If this is a shared library prerequisite, install it as long as it is - // in the installation scope. - // - // Less obvious: we also want to install a static library prerequisite - // of a library (since it could be referenced from its .pc file, etc). - // - // Note: for now we assume these prerequisites never come from see- - // through groups. - // - // Note: we install ad hoc prerequisites by default. - // - - // Note: at least one must be true since we only register this rule for - // exe{}, and lib[as]{} (this makes sure the following if-condition will - // always be true for libx{}). - // - bool st (t.is_a () || t.is_a ()); // Target needs shared. - bool at (t.is_a () || t.is_a ()); // Target needs static. - assert (st || at); - - if ((st && (p.is_a () || p.is_a ())) || - (at && (p.is_a () || p.is_a ()))) - { - const target* pt (&search (t, p)); - - // If this is the lib{}/libu*{} group, pick a member which we would - // 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)); - - // Note: not redundant since we could be returning a member. - // - if ((st && pt->is_a ()) || (at && pt->is_a ())) - { - // Adjust match options. - // - if (a.operation () != update_id) - { - if (t.is_a ()) - options = lib::option_install_runtime; - else - { - // This is a library prerequisite of a library target and - // runtime-only begets runtime-only. - // - if (me.cur_options == lib::option_install_runtime) - options = lib::option_install_runtime; - } - } - - return make_pair (is == nullptr || pt->in (*is) ? pt : nullptr, - options); - } - - // See through to libu*{} members. Note that we are always in the same - // project (and thus amalgamation). - // - if (pt->is_a ()) - { - // Adjust match options (similar to above). - // - if (a.operation () != update_id && !pt->is_a ()) - { - if (t.is_a ()) - options = lib::option_install_runtime; - else - { - if (me.cur_options == lib::option_install_runtime) - options = lib::option_install_runtime; - } - } - - return make_pair (pt, options); - } - } -#else // Note that at first it may seem like we don't need to install static // library prerequisites of executables. But such libraries may still // have prerequisites that are needed at runtime (say, some data files). @@ -209,7 +129,6 @@ namespace build2 return make_pair (pt, options); } } -#endif // The rest of the tests only succeed if the base filter() succeeds. // @@ -561,56 +480,6 @@ namespace build2 // above. In particular, here we use libue/libua/libus{} as proxies for // exe/liba/libs{} there. // - - // @@ TMP: drop eventually. - // -#if 0 - bool st (t.is_a () || t.is_a ()); // Target needs shared. - bool at (t.is_a () || t.is_a ()); // Target needs static. - assert (st || at); - - if ((st && (p.is_a () || p.is_a ())) || - (at && (p.is_a () || p.is_a ()))) - { - 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 ((st && pt->is_a ()) || (at && pt->is_a ())) - { - if (a.operation () != update_id) - { - if (t.is_a ()) - options = lib::option_install_runtime; - else - { - if (me.cur_options == lib::option_install_runtime) - options = lib::option_install_runtime; - } - } - - return make_pair (is == nullptr || pt->in (*is) ? pt : nullptr, - options); - } - - if (pt->is_a ()) - { - if (a.operation () != update_id && !pt->is_a ()) - { - if (t.is_a ()) - options = lib::option_install_runtime; - else - { - if (me.cur_options == lib::option_install_runtime) - options = lib::option_install_runtime; - } - } - - return make_pair (pt, options); - } - } -#else if (p.is_a () || p.is_a () || p.is_a ()) { const target* pt (&search (t, p)); @@ -637,7 +506,6 @@ namespace build2 else return make_pair (pt, options); } -#endif const target* pt (file_rule::instance.filter (is, a, t, p, me).first); if (pt == nullptr) -- cgit v1.1