From a9cadecf15385f93ad3eb6b6b0bdeaafd741b0a7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 31 Jan 2020 15:34:13 +0200 Subject: Propagate installed library out (tag) when converting to name --- libbuild2/cc/pkgconfig.cxx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'libbuild2/cc/pkgconfig.cxx') diff --git a/libbuild2/cc/pkgconfig.cxx b/libbuild2/cc/pkgconfig.cxx index 9d372e2..775b055 100644 --- a/libbuild2/cc/pkgconfig.cxx +++ b/libbuild2/cc/pkgconfig.cxx @@ -846,8 +846,9 @@ namespace build2 bool all (true); optional usrd; // Populate lazily. - for (name& n: libs) + for (auto i (libs.begin ()); i != libs.end (); ++i) { + name& n (*i); string& l (n.value); // These ones are common/standard/POSIX. @@ -913,10 +914,10 @@ namespace build2 // resolve_library(). // dir_path out; - string name (l, 2); // Sans -l. + string nm (l, 2); // Sans -l. prerequisite_key pk { - nullopt, {&lib::static_type, &out, &out, &name, nullopt}, &s}; + nullopt, {&lib::static_type, &out, &out, &nm, nullopt}, &s}; if (const target* lt = search_library (a, top_sysd, usrd, pk)) { @@ -927,6 +928,12 @@ namespace build2 n.type = lib::static_type.name; n.value = lt->name; + if (!lt->out.empty ()) + { + n.pair = true; + i = libs.insert (i + 1, name (lt->out)); + } + if (ps != nullptr) ps->push_back (prerequisite (*lt)); } @@ -940,7 +947,7 @@ namespace build2 { // Translate -l to .lib. // - l = move (name += ".lib"); + l = move (nm += ".lib"); } } } -- cgit v1.1