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/cc/compile.cxx | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'build2/cc/compile.cxx') diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx index c8394a9..3039f00 100644 --- a/build2/cc/compile.cxx +++ b/build2/cc/compile.cxx @@ -213,7 +213,9 @@ namespace build2 const scope& bs (t.base_scope ()); const scope& rs (*bs.root_scope ()); + otype ct (compile_type (t)); + lorder lo (link_order (bs, ct)); // Derive file name from target name. // @@ -286,16 +288,24 @@ namespace build2 { if (a.operation () == update_id) { - // Handle imported libraries. We know that for such libraries - // we don't need to do match() in order to get options (if - // any, they would be set by search_library()). + // Handle imported libraries. We know that for such libraries we + // don't need to do match() in order to get options (if any, they + // would be set by search_library()). // - if (!p.proj () || - search_library ( - sys_lib_dirs, usr_lib_dirs, p.prerequisite) == nullptr) + if (p.proj ()) { - match_only (ml, a, p.search ()); + if (search_library (sys_lib_dirs, + usr_lib_dirs, + p.prerequisite) != nullptr) + continue; } + + target* pt (&p.search ()); + + if (lib* l = pt->is_a ()) + pt = &link_member (*l, lo); + + match_only (ml, a, *pt); } continue; @@ -316,8 +326,6 @@ namespace build2 // if (a == perform_update_id) { - lorder lo (link_order (bs, ct)); - // The cached prerequisite target should be the same as what is in // t.prerequisite_targets since we used standard search() and match() // above. -- cgit v1.1