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 +++++++++++--------------------------- build2/bin/target | 3 --- build2/bin/target.cxx | 9 --------- 3 files changed, 11 insertions(+), 39 deletions(-) (limited to 'build2/bin') 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; } diff --git a/build2/bin/target b/build2/bin/target index 0108f09..4157f67 100644 --- a/build2/bin/target +++ b/build2/bin/target @@ -94,9 +94,6 @@ namespace build2 const_ptr a = nullptr; const_ptr s = nullptr; - virtual void - reset (action_type) override; - public: static const target_type static_type; diff --git a/build2/bin/target.cxx b/build2/bin/target.cxx index caef8e0..ea0a1ac 100644 --- a/build2/bin/target.cxx +++ b/build2/bin/target.cxx @@ -201,15 +201,6 @@ namespace build2 // lib // - void lib:: - reset (action_type) - { - clear_data (); - - // Don't clear prerequisite_targets since it is "given" to our - // members to implement "library meta-information protocol". - } - static pair> lib_factory (const target_type&, dir_path d, -- cgit v1.1