From d69e09acb570030a56566739569867139f5d1f4b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 25 May 2018 11:48:37 +0200 Subject: Change default install filter to only accept prerequisites from amalgamation --- build2/cc/install-rule.cxx | 2 ++ build2/cc/pkgconfig.cxx | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'build2/cc') diff --git a/build2/cc/install-rule.cxx b/build2/cc/install-rule.cxx index eda6ba0..a7e05b0 100644 --- a/build2/cc/install-rule.cxx +++ b/build2/cc/install-rule.cxx @@ -57,6 +57,8 @@ namespace build2 if (const libx* l = pt->is_a ()) pt = &link_member (*l, a, link_info (t.base_scope (), ot)); + // Note: not redundant since we are returning a member. + // if ((st && pt->is_a ()) || (at && pt->is_a ())) return pt->in (t.weak_scope ()) ? pt : nullptr; diff --git a/build2/cc/pkgconfig.cxx b/build2/cc/pkgconfig.cxx index ce73efd..5ace6ec 100644 --- a/build2/cc/pkgconfig.cxx +++ b/build2/cc/pkgconfig.cxx @@ -1125,6 +1125,14 @@ namespace build2 assert (t != nullptr); const path& p (t->path ()); + auto_rmfile arm (p); + + // By default we assume things go into install.{include, lib}. + // + using install::resolve_dir; + + dir_path idir (resolve_dir (l, cast (l["install.include"]))); + dir_path ldir (resolve_dir (l, cast (l["install.lib"]))); if (verb >= 2) text << "cat >" << p; @@ -1132,7 +1140,6 @@ namespace build2 try { ofdstream os (p); - auto_rmfile arm (p); { const string& n (cast (rs.vars[var_project])); @@ -1225,19 +1232,13 @@ namespace build2 os << " -l" << n; }; - // By default we assume things go into install.{include, lib}. - // // @@ TODO: support whole archive? // - using install::resolve_dir; - - dir_path id (resolve_dir (l, cast (l["install.include"]))); - dir_path ld (resolve_dir (l, cast (l["install.lib"]))); // Cflags. // os << "Cflags:"; - os << " -I" << escape (id.string ()); + os << " -I" << escape (idir.string ()); save_poptions (c_export_poptions); save_poptions (x_export_poptions); os << endl; @@ -1256,7 +1257,7 @@ namespace build2 // Libs.private split. // os << "Libs:"; - os << " -L" << escape (ld.string ()); + os << " -L" << escape (ldir.string ()); // Now process ourselves as if we were being linked to something (so // pretty similar to link_rule::append_libraries()). -- cgit v1.1