From b7b30102882f0a85c169a0eb4944a8f1c344c9e1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 1 Aug 2017 15:29:24 +0200 Subject: Add version, project.summary, project.url built-in variables Extract them from manifest in the version module. Use them when generating the pkg-config's .pc files. --- build2/version/init.cxx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'build2/version/init.cxx') diff --git a/build2/version/init.cxx b/build2/version/init.cxx index 699495a..c6acf88 100644 --- a/build2/version/init.cxx +++ b/build2/version/init.cxx @@ -36,8 +36,12 @@ namespace build2 tracer trace ("version::boot"); l5 ([&]{trace << "for " << rs.out_path ();}); - // Extract the version from the manifest file. + // Extract the version from the manifest file. As well as summary and + // url while at it. // + string sum; + string url; + standard_version v; dependency_constraints ds; { @@ -57,7 +61,11 @@ namespace build2 for (nv = p.next (); !nv.empty (); nv = p.next ()) { - if (nv.name == "version") + if (nv.name == "summary") + sum = move (nv.value); + else if (nv.name == "url") + url = move (nv.value); + else if (nv.name == "version") { try { @@ -180,7 +188,10 @@ namespace build2 rs.assign (v) = move (val); }; - set ("version", v.string ()); // Package version. + if (!sum.empty ()) rs.assign (var_project_summary) = move (sum); + if (!url.empty ()) rs.assign (var_project_url) = move (url); + + set ("version", v.string ()); // Project version (var_version). set ("version.project", v.string_project ()); set ("version.project_number", v.version); -- cgit v1.1