From 0b672184ef920d2581a0be43d27c25690ee0569d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 23 May 2022 14:40:07 +0200 Subject: Cache build.host value in context --- libbuild2/context.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libbuild2/context.cxx') diff --git a/libbuild2/context.cxx b/libbuild2/context.cxx index 7b465b4..a7df959 100644 --- a/libbuild2/context.cxx +++ b/libbuild2/context.cxx @@ -134,11 +134,12 @@ namespace build2 // Any variable assigned on the global scope should natually have the // global visibility. // - auto set = [&gs, &vp] (const char* var, auto val) + auto set = [&gs, &vp] (const char* var, auto val) -> const value& { using T = decltype (val); value& v (gs.assign (vp.insert (var, variable_visibility::global))); v = move (val); + return v; }; // Build system mode. @@ -268,7 +269,7 @@ namespace build2 set ("build.host.version", t.version); set ("build.host.class", t.class_); - set ("build.host", move (t)); + build_host = &set ("build.host", move (t)).as (); } catch (const invalid_argument& e) { -- cgit v1.1