From 421d0a4d1a7786e90407072b378cc060d325907d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 23 Aug 2019 09:46:11 +0200 Subject: Variables --- libbuild2/version/init.cxx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'libbuild2/version/init.cxx') diff --git a/libbuild2/version/init.cxx b/libbuild2/version/init.cxx index faa6e38..1c123bf 100644 --- a/libbuild2/version/init.cxx +++ b/libbuild2/version/init.cxx @@ -37,6 +37,8 @@ namespace build2 tracer trace ("version::boot"); l5 ([&]{trace << "for " << rs;}); + context& ctx (rs.ctx); + // Extract the version from the manifest file. As well as summary and // url while at it. // @@ -67,7 +69,7 @@ namespace build2 { if (nv.name == "name") { - auto& pn (cast (rs.vars[var_project])); + auto& pn (cast (rs.vars[ctx.var_project])); if (nv.value != pn.string ()) { @@ -219,7 +221,7 @@ namespace build2 // Set all the version.* variables. // - auto& vp (rs.ctx.var_pool.rw (rs)); + auto& vp (ctx.var_pool.rw (rs)); auto set = [&vp, &rs] (const char* var, auto val) { @@ -228,8 +230,8 @@ namespace build2 rs.assign (v) = move (val); }; - if (!sum.empty ()) rs.assign (var_project_summary) = move (sum); - if (!url.empty ()) rs.assign (var_project_url) = move (url); + if (!sum.empty ()) rs.assign (ctx.var_project_summary) = move (sum); + if (!url.empty ()) rs.assign (ctx.var_project_url) = move (url); set ("version", v.string ()); // Project version (var_version). @@ -268,7 +270,7 @@ namespace build2 // Create the module. // - mod.reset (new module (cast (rs.vars[var_project]), + mod.reset (new module (cast (rs.vars[ctx.var_project]), move (v), committed, rewritten, @@ -294,6 +296,8 @@ namespace build2 if (!first) fail (l) << "multiple version module initializations"; + context& ctx (rs.ctx); + // Load in.base (in.* variables, in{} target type). // if (!cast_false (rs["in.base.loaded"])) @@ -320,7 +324,7 @@ namespace build2 if (!val) { - string p (cast (rs.vars[var_project]).string ()); + string p (cast (rs.vars[ctx.var_project]).string ()); p += '-'; p += v.string (); val = move (p); -- cgit v1.1