From 8a7b3bb944ca08d240fc778a9269c6db0f9746f8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 14 Feb 2017 09:56:42 +0200 Subject: Modify library mate-information protocol not to use lib{} group --- build2/bin/rule.cxx | 38 +++++++++++--------------------------- 1 file changed, 11 insertions(+), 27 deletions(-) (limited to 'build2/bin/rule.cxx') diff --git a/build2/bin/rule.cxx b/build2/bin/rule.cxx index ea84971..075af0e 100644 --- a/build2/bin/rule.cxx +++ b/build2/bin/rule.cxx @@ -46,7 +46,7 @@ namespace build2 "insufficient space"); match_result lib_rule:: - match (slock& ml, action act, target& xt, const string&) const + match (slock&, action act, target& xt, const string&) const { lib& t (xt.as ()); @@ -64,30 +64,6 @@ namespace build2 fail << "unknown library type: " << type << info << "'static', 'shared', or 'both' expected"; - // Search and pre-match the members. The pre-match here is part - // of the "library meta-information protocol" that could be used - // by the module that actually builds the members. The idea is - // that pre-matching members may populate our prerequisite_targets - // with prerequisite libraries from which others can extract the - // meta-information about the library, such as the options to use - // when linking it, etc. - // - if (a) - { - if (t.a == nullptr) - t.a = &search (t.dir, t.out, t.name, nullptr, nullptr); - - match_only (ml, act, *t.a); - } - - if (s) - { - if (t.s == nullptr) - t.s = &search (t.dir, t.out, t.name, nullptr, nullptr); - - match_only (ml, act, *t.s); - } - t.data (match_data {type}); // Save in the target's auxilary storage. match_result mr (true); @@ -112,13 +88,21 @@ namespace build2 bool a (type == "static" || type == "both"); bool s (type == "shared" || type == "both"); - // Now we do full match. - // if (a) + { + if (t.a == nullptr) + t.a = &search (t.dir, t.out, t.name, nullptr, nullptr); + build2::match (ml, act, *t.a); + } if (s) + { + if (t.s == nullptr) + t.s = &search (t.dir, t.out, t.name, nullptr, nullptr); + build2::match (ml, act, *t.s); + } return &perform; } -- cgit v1.1