diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-08-01 14:13:07 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-08-01 14:13:07 +0200 |
commit | b810a034499e1cdc27e03714721b4de085da6d3a (patch) | |
tree | eba59acaba93e031ab6d05e6a72b6754cbde3e00 | |
parent | aaaa1f3cda4383511c89721b4d7d53d53dd29343 (diff) |
Fix bug in pdb member search
-rw-r--r-- | build2/cc/windows-rpath.cxx | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/build2/cc/windows-rpath.cxx b/build2/cc/windows-rpath.cxx index 0cc8246..48e40bd 100644 --- a/build2/cc/windows-rpath.cxx +++ b/build2/cc/windows-rpath.cxx @@ -7,6 +7,7 @@ #include <build2/scope.hxx> #include <build2/context.hxx> #include <build2/variable.hxx> +#include <build2/algorithm.hxx> #include <build2/filesystem.hxx> #include <build2/diagnostics.hxx> @@ -134,7 +135,7 @@ namespace build2 auto imp = [] (const file&, bool) {return true;}; - auto lib = [&r] (const file* l, const string& f, lflags, bool sys) + auto lib = [&r, &bs] (const file* l, const string& f, lflags, bool sys) { if (sys) return; @@ -143,14 +144,17 @@ namespace build2 { if (l->is_a<libs> () && !l->path ().empty ()) { - // Get .pdb if there is one (second member of the ad hoc group). + // Get .pdb if there is one. // - const string* pdb ( - l->member != nullptr && l->member->member != nullptr - ? &l->member->member->as<file> ().path ().string () - : nullptr); - - r.insert (windows_dll {f, pdb, string ()}); + const target* pdb ( + find_adhoc_member (*l, *bs.find_target_type ("pdb"))); + + r.insert ( + windows_dll { + f, + pdb != nullptr ? &pdb->as<file> ().path ().string () : nullptr, + string () + }); } } else |