From ecfae2da0b23631cee3e723a562f64f8aace6879 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 16 Jun 2020 09:43:27 +0200 Subject: Move common functionality from cc to bin --- libbuild2/bin/rule.cxx | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'libbuild2/bin/rule.cxx') diff --git a/libbuild2/bin/rule.cxx b/libbuild2/bin/rule.cxx index a2cdf8c..0abfcb5 100644 --- a/libbuild2/bin/rule.cxx +++ b/libbuild2/bin/rule.cxx @@ -9,6 +9,7 @@ #include #include +#include using namespace std; @@ -36,29 +37,14 @@ namespace build2 // The whole logic is pretty much as if we had our two group members as // our prerequisites. // - lib_rule::members lib_rule:: - build_members (const scope& rs) - { - const string& type (cast (rs["bin.lib"])); - - bool a (type == "static" || type == "both"); - bool s (type == "shared" || type == "both"); - - if (!a && !s) - fail << "unknown library type: " << type << - info << "'static', 'shared', or 'both' expected"; - - return members {a, s}; - } - bool lib_rule:: match (action a, target& xt, const string&) const { lib& t (xt.as ()); - members bm (a.meta_operation () != dist_id - ? build_members (t.root_scope ()) - : members {true, true}); + lmembers bm (a.meta_operation () != dist_id + ? link_members (t.root_scope ()) + : lmembers {true, true}); t.a = bm.a ? &search (t, t.dir, t.out, t.name) : nullptr; t.s = bm.s ? &search (t, t.dir, t.out, t.name) : nullptr; -- cgit v1.1