From bbd0f3bb21442a2833916110cbe8e9a07e9f4c1f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 31 Jul 2015 12:52:20 +0200 Subject: Essential install module functionality --- build/config/utility.txx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'build/config/utility.txx') diff --git a/build/config/utility.txx b/build/config/utility.txx index bee8a0b..cffdecf 100644 --- a/build/config/utility.txx +++ b/build/config/utility.txx @@ -57,5 +57,29 @@ namespace build return r; } + + template + void + append_options (cstrings& args, T& s, const char* var) + { + if (auto val = s[var]) + append_options (args, val.template as (), var); + } + + template + bool + find_option (const char* option, T& s, const char* var) + { + if (auto val = s[var]) + { + for (const name& n: val.template as ()) + { + if (n.simple () && n.value == option) + return true; + } + } + + return false; + } } } -- cgit v1.1