From a84ff43b183181e0a12c6d5e31c1f366d39ce2fe Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 31 Jul 2017 18:42:47 +0200 Subject: Experimental (and probably broken) pkg-config generation support --- build2/pkgconfig/init.cxx | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'build2/pkgconfig/init.cxx') diff --git a/build2/pkgconfig/init.cxx b/build2/pkgconfig/init.cxx index fa22421..9526aa7 100644 --- a/build2/pkgconfig/init.cxx +++ b/build2/pkgconfig/init.cxx @@ -10,6 +10,9 @@ #include #include +#include + +#include using namespace std; using namespace butl; @@ -128,7 +131,7 @@ namespace build2 bool init (scope& rs, - scope& bs, + scope&, const location& loc, unique_ptr&, bool, @@ -136,14 +139,15 @@ namespace build2 const variable_map& hints) { tracer trace ("pkgconfig::init"); - l5 ([&]{trace << "for " << bs.out_path ();}); + l5 ([&]{trace << "for " << rs.out_path ();}); // Load pkgconfig.config. // + bool conf (true); if (!cast_false (rs["pkgconfig.config.loaded"])) { if (!load_module (rs, rs, "pkgconfig.config", loc, optional, hints)) - return false; + conf = false; } else if (!cast_false (rs["pkgconfig.config.configured"])) { @@ -151,13 +155,21 @@ namespace build2 fail << "pkgconfig module could not be configured" << info << "re-run with -V option for more information"; - return false; + conf = false; } - // For now pkgconfig and pkgconfig.config is pretty much the same. + // Register the target type and configure its default "installability". + // + // Note that we do it whether we found pkg-config or not since these are + // used to produce .pc files which we do regardless. // + rs.target_types.insert (); + rs.target_types.insert (); - return true; + if (cast_false (rs["install.loaded"])) + install::install_path (rs, dir_path ("pkgconfig")); + + return conf; } } } -- cgit v1.1