diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-01-31 15:34:13 +0200 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-01-31 18:08:57 +0300 |
commit | a9cadecf15385f93ad3eb6b6b0bdeaafd741b0a7 (patch) | |
tree | 3212b7b09d719ea8bc2688756e391ebd87dc3bc6 /libbuild2/cc/pkgconfig.cxx | |
parent | 50ae0c791cf94199c4cdc1674d8562b1c00046ea (diff) |
Propagate installed library out (tag) when converting to name
Diffstat (limited to 'libbuild2/cc/pkgconfig.cxx')
-rw-r--r-- | libbuild2/cc/pkgconfig.cxx | 15 |
1 files changed, 11 insertions, 4 deletions
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<dir_paths> 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<name> to <name>.lib. // - l = move (name += ".lib"); + l = move (nm += ".lib"); } } } |