aboutsummaryrefslogtreecommitdiff
path: root/build/variable.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-07-21 16:21:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-07-21 16:21:07 +0200
commita1cec9e0df14f3c1a833e2a447b5324ff9c430d3 (patch)
treee61c7e1cb3fa27ba435053761f5a2a3fb670f728 /build/variable.cxx
parentbead742dbac51088e89cdd4dd7a55aaa1d8c98d7 (diff)
Test module genesis
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'.
+ }
}