aboutsummaryrefslogtreecommitdiff
path: root/build2/bin
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-01-11 10:14:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-01-12 10:58:19 +0200
commit9bf93c1ab73ee3cd2b763285fc5fc5456e972854 (patch)
tree0357c36e12fe2137ef6c9bd228e9d69bb2489a02 /build2/bin
parent33ed305eac57bff406fa3f672ba8acc4941e8f13 (diff)
Implement support for narrowing down tests (config.test)
Diffstat (limited to 'build2/bin')
-rw-r--r--build2/bin/init.cxx46
1 files changed, 23 insertions, 23 deletions
diff --git a/build2/bin/init.cxx b/build2/bin/init.cxx
index e1b812b..eaded2a 100644
--- a/build2/bin/init.cxx
+++ b/build2/bin/init.cxx
@@ -112,7 +112,7 @@ namespace build2
{
value& v (b.assign ("bin.lib"));
if (!v)
- v = required (r, "config.bin.lib", "both").first;
+ v = *required (r, "config.bin.lib", "both").first;
}
// config.bin.exe.lib
@@ -120,7 +120,7 @@ namespace build2
{
value& v (b.assign ("bin.exe.lib"));
if (!v)
- v = required (r, "config.bin.exe.lib", exe_lib).first;
+ v = *required (r, "config.bin.exe.lib", exe_lib).first;
}
// config.bin.liba.lib
@@ -128,7 +128,7 @@ namespace build2
{
value& v (b.assign ("bin.liba.lib"));
if (!v)
- v = required (r, "config.bin.liba.lib", liba_lib).first;
+ v = *required (r, "config.bin.liba.lib", liba_lib).first;
}
// config.bin.libs.lib
@@ -136,7 +136,7 @@ namespace build2
{
value& v (b.assign ("bin.libs.lib"));
if (!v)
- v = required (r, "config.bin.libs.lib", libs_lib).first;
+ v = *required (r, "config.bin.libs.lib", libs_lib).first;
}
// config.bin.rpath
@@ -154,16 +154,16 @@ namespace build2
// that might have been specified before loading the module.
//
{
- const value* p (omitted (r, "config.bin.prefix").first);
- const value* s (omitted (r, "config.bin.suffix").first);
+ lookup p (omitted (r, "config.bin.prefix").first);
+ lookup s (omitted (r, "config.bin.suffix").first);
- auto set = [&r, &b] (const char* bv, const char* cv, const value* v)
+ auto set = [&r, &b] (const char* bv, const char* cv, lookup l)
{
- if (const value* o = omitted (r, cv).first)
- v = o;
+ if (lookup o = omitted (r, cv).first)
+ l = o;
- if (v != nullptr)
- b.assign (bv) = *v;
+ if (l)
+ b.assign (bv) = *l;
};
set ("bin.lib.prefix", "config.bin.lib.prefix", p);
@@ -186,21 +186,21 @@ namespace build2
// mechanism.
//
auto p (omitted (r, var));
- const value* v (p.first);
+ lookup l (p.first);
// Then see if there is a config hint (e.g., from the C++ module).
//
bool hint (false);
- if (v == nullptr)
+ if (!l)
{
- if (auto l = hints[var])
+ if (auto hl = hints[var])
{
- v = l.value;
+ l = hl;
hint = true;
}
}
- if (v == nullptr)
+ if (!l)
fail (loc) << "unable to determine binutils target" <<
info << "consider specifying it with " << var <<
info << "or first load a module that can provide it as a hint, "
@@ -208,7 +208,7 @@ namespace build2
// Split/canonicalize the target.
//
- string s (cast<string> (*v));
+ string s (cast<string> (l));
// Did the user ask us to use config.sub? If this is a hinted value,
// then we assume it has already been passed through config.sub.
@@ -262,22 +262,22 @@ namespace build2
// mechanism.
//
auto p (omitted (r, var));
- const value* v (p.first);
+ lookup l (p.first);
// Then see if there is a config hint (e.g., from the C++ module).
//
- if (v == nullptr)
+ if (!l)
{
- if (auto l = hints[var])
- v = l.value;
+ if (auto hl = hints[var])
+ l = hl;
}
// For ease of use enter it as bin.pattern (since it can come from
// different places).
//
- if (v != nullptr)
+ if (l)
{
- const string& s (cast<string> (*v));
+ const string& s (cast<string> (l));
if (s.empty () ||
(!path::traits::is_separator (s.back ()) &&