From 68f96f9213e849d0d7c4cedf3edeaec99743ee27 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 24 Aug 2015 09:51:15 +0200 Subject: New variable architecture --- build/cxx/compile.cxx | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) (limited to 'build/cxx/compile.cxx') diff --git a/build/cxx/compile.cxx b/build/cxx/compile.cxx index 8dcad1e..65806ed 100644 --- a/build/cxx/compile.cxx +++ b/build/cxx/compile.cxx @@ -166,23 +166,23 @@ namespace build { ext_map m; - if (auto val = r["h.ext"]) - m[&extension_pool.find (val.as ())] = &h::static_type; + if (auto l = r["h.ext"]) + m[&extension_pool.find (as (*l))] = &h::static_type; - if (auto val = r["c.ext"]) - m[&extension_pool.find (val.as ())] = &c::static_type; + if (auto l = r["c.ext"]) + m[&extension_pool.find (as (*l))] = &c::static_type; - if (auto val = r["hxx.ext"]) - m[&extension_pool.find (val.as ())] = &hxx::static_type; + if (auto l = r["hxx.ext"]) + m[&extension_pool.find (as (*l))] = &hxx::static_type; - if (auto val = r["ixx.ext"]) - m[&extension_pool.find (val.as ())] = &ixx::static_type; + if (auto l = r["ixx.ext"]) + m[&extension_pool.find (as (*l))] = &ixx::static_type; - if (auto val = r["txx.ext"]) - m[&extension_pool.find (val.as ())] = &txx::static_type; + if (auto l = r["txx.ext"]) + m[&extension_pool.find (as (*l))] = &txx::static_type; - if (auto val = r["cxx.ext"]) - m[&extension_pool.find (val.as ())] = &cxx::static_type; + if (auto l = r["cxx.ext"]) + m[&extension_pool.find (as (*l))] = &cxx::static_type; return m; } @@ -215,26 +215,24 @@ namespace build const dir_path& out_base (t.dir); const dir_path& out_root (rs->path ()); - if (auto val = t[var]) + if (auto l = t[var]) { - const list_value& l (val.template as ()); + const auto& v (as (*l)); - // Assume the names have already been vetted by append_options(). - // - for (auto i (l.begin ()), e (l.end ()); i != e; ++i) + for (auto i (v.begin ()), e (v.end ()); i != e; ++i) { - // -I can either be in the -Ifoo or -I foo form. + // -I can either be in the "-Ifoo" or "-I foo" form. // dir_path d; - if (i->value == "-I") + if (*i == "-I") { if (++i == e) break; // Let the compiler complain. - d = i->simple () ? dir_path (i->value) : i->dir; + d = dir_path (*i); } - else if (i->value.compare (0, 2, "-I") == 0) - d = dir_path (i->value, 2, string::npos); + else if (i->compare (0, 2, "-I") == 0) + d = dir_path (*i, 2, string::npos); else continue; @@ -368,7 +366,7 @@ namespace build tracer trace ("cxx::compile::inject_prerequisites"); scope& rs (t.root_scope ()); - const string& cxx (rs["config.cxx"].as ()); + const string& cxx (as (*rs["config.cxx"])); cstrings args {cxx.c_str ()}; @@ -715,7 +713,7 @@ namespace build path rels (relative (s->path ())); scope& rs (t.root_scope ()); - const string& cxx (rs["config.cxx"].as ()); + const string& cxx (as (*rs["config.cxx"])); cstrings args {cxx.c_str ()}; -- cgit v1.1