aboutsummaryrefslogtreecommitdiff
path: root/build2/cc
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-08-23 09:46:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-08-23 09:46:11 +0200
commit421d0a4d1a7786e90407072b378cc060d325907d (patch)
tree881b02405e74c11c74979bc6cd5df4f313c209cf /build2/cc
parent6cc8301e4fb819393c1245cea0fbfb89e69b90b4 (diff)
Variables
Diffstat (limited to 'build2/cc')
-rw-r--r--build2/cc/pkgconfig.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/build2/cc/pkgconfig.cxx b/build2/cc/pkgconfig.cxx
index 13cc752..038ecc6 100644
--- a/build2/cc/pkgconfig.cxx
+++ b/build2/cc/pkgconfig.cxx
@@ -1228,6 +1228,8 @@ namespace build2
{
tracer trace (x, "pkgconfig_save");
+ context& ctx (l.ctx);
+
const scope& bs (l.base_scope ());
const scope& rs (*bs.root_scope ());
@@ -1256,9 +1258,12 @@ namespace build2
ofdstream os (p);
{
- const project_name& n (cast<project_name> (rs.vars[var_project]));
+ const project_name& n (project (rs));
+
+ if (n.empty ())
+ fail << "no project name in " << rs;
- lookup vl (rs.vars[var_version]);
+ lookup vl (rs.vars[ctx.var_version]);
if (!vl)
fail << "no version variable in project " << n <<
info << "while generating " << p;
@@ -1271,12 +1276,12 @@ namespace build2
// This one is required so make something up if unspecified.
//
os << "Description: ";
- if (const string* s = cast_null<string> (rs[var_project_summary]))
+ if (const string* s = cast_null<string> (rs[ctx.var_project_summary]))
os << *s << endl;
else
os << n << ' ' << v << endl;
- if (const string* u = cast_null<string> (rs[var_project_url]))
+ if (const string* u = cast_null<string> (rs[ctx.var_project_url]))
os << "URL: " << *u << endl;
}