aboutsummaryrefslogtreecommitdiff
path: root/build/variable.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build/variable.cxx')
-rw-r--r--build/variable.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/build/variable.cxx b/build/variable.cxx
index d00fcf6..eab77e5 100644
--- a/build/variable.cxx
+++ b/build/variable.cxx
@@ -70,4 +70,20 @@ namespace build
assert (n.directory ());
return n.dir;
}
+
+ template <>
+ bool value_proxy::
+ as<bool> () const
+ {
+ const list_value& lv (as<const list_value&> ());
+ assert (lv.size () == 1);
+ const name& n (lv.front ());
+ assert (n.simple ());
+ if (n.value == "true")
+ return true;
+ else if (n.value == "false")
+ return false;
+ else
+ assert (false); // Bool value should be 'true' or 'false'.
+ }
}