From b810a034499e1cdc27e03714721b4de085da6d3a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 1 Aug 2017 14:13:07 +0200 Subject: Fix bug in pdb member search --- build2/cc/windows-rpath.cxx | 20 ++++++++++++-------- 1 file 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 #include #include +#include #include #include @@ -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 () && !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 ().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 ().path ().string () : nullptr, + string () + }); } } else -- cgit v1.1