aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-12-27 17:23:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-12-27 17:23:11 +0200
commitba8ce9226af026f873883b7d4e29079bbfece586 (patch)
treecece80f4f571d0548c7ae30f28edc41d282958b9
parentdaa816fc2e7c6cbb669ba030d45dd979ef37f7c2 (diff)
Fix logic bug in pkg-config shared/static selection
-rw-r--r--build2/cc/pkgconfig.cxx24
1 files changed, 13 insertions, 11 deletions
diff --git a/build2/cc/pkgconfig.cxx b/build2/cc/pkgconfig.cxx
index 1630076..c35569c 100644
--- a/build2/cc/pkgconfig.cxx
+++ b/build2/cc/pkgconfig.cxx
@@ -1131,16 +1131,6 @@ namespace build2
for (const dir_path& d: top_usrd) pkgconfig_search (d, add_pc_dir);
for (const dir_path& d: top_sysd) pkgconfig_search (d, add_pc_dir);
- // First sort out the interface dependencies (which we are setting on
- // lib{}). If we have the shared .pc variant, then we use that.
- // Otherwise -- static but extract without the --static option (see also
- // the saving logic).
- //
- pkgconf& ipc (sp.empty () ? apc : spc); // Interface package info.
- bool ibl ((sp.empty ()
- ? at->mtime ()
- : st->mtime ()) == timestamp_unreal); // Binless.
-
bool pa (at != nullptr && !ap.empty ());
if (pa || sp.empty ())
apc = pkgconf (ap, pc_dirs, sys_lib_dirs, sys_inc_dirs);
@@ -1149,7 +1139,19 @@ namespace build2
if (ps || ap.empty ())
spc = pkgconf (sp, pc_dirs, sys_lib_dirs, sys_inc_dirs);
- parse_libs (lt, ibl, ipc, false, &prs);
+ // Sort out the interface dependencies (which we are setting on lib{}).
+ // If we have the shared .pc variant, then we use that. Otherwise --
+ // static but extract without the --static option (see also the saving
+ // logic).
+ //
+ pkgconf& ipc (ps ? spc : apc); // Interface package info.
+
+ parse_libs (
+ lt,
+ (ps ? st->mtime () : at->mtime ()) == timestamp_unreal /* binless */,
+ ipc,
+ false,
+ &prs);
if (pa)
{