diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-06-16 09:43:27 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-06-16 09:43:27 +0200 |
commit | ecfae2da0b23631cee3e723a562f64f8aace6879 (patch) | |
tree | 6f7bae1bec966bcc456b71fbaabf8556f031d61b /libbuild2/bin/rule.cxx | |
parent | bd9ca1e55dc1396da73c4699ccc021dc1f604fe6 (diff) |
Move common functionality from cc to bin
Diffstat (limited to 'libbuild2/bin/rule.cxx')
-rw-r--r-- | libbuild2/bin/rule.cxx | 22 |
1 files changed, 4 insertions, 18 deletions
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 <libbuild2/diagnostics.hxx> #include <libbuild2/bin/target.hxx> +#include <libbuild2/bin/utility.hxx> 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<string> (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<lib> ()); - 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<liba> (t, t.dir, t.out, t.name) : nullptr; t.s = bm.s ? &search<libs> (t, t.dir, t.out, t.name) : nullptr; |