aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/pkgconfig.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/cc/pkgconfig.cxx')
-rw-r--r--build2/cc/pkgconfig.cxx19
1 files changed, 12 insertions, 7 deletions
diff --git a/build2/cc/pkgconfig.cxx b/build2/cc/pkgconfig.cxx
index c23b746..3b4c711 100644
--- a/build2/cc/pkgconfig.cxx
+++ b/build2/cc/pkgconfig.cxx
@@ -1027,7 +1027,7 @@ namespace build2
// Parse modules and add them to the prerequisites.
//
- auto parse_modules = [&trace, &next, this]
+ auto parse_modules = [&trace, &next, &s, this]
(const pkgconf& pc, prerequisites& ps)
{
string mstr (pc.variable ("cxx_modules"));
@@ -1057,7 +1057,7 @@ namespace build2
// For now there are only C++ modules.
//
auto tl (
- targets.insert_locked (
+ s.ctx.targets.insert_locked (
*x_mod,
mp.directory (),
dir_path (),
@@ -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 ());
@@ -1246,7 +1248,7 @@ namespace build2
if (verb >= 2)
text << "cat >" << p;
- if (dry_run)
+ if (ctx.dry_run)
return;
auto_rmfile arm (p);
@@ -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;
}