diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-07-31 12:52:20 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-07-31 12:52:20 +0200 |
commit | bbd0f3bb21442a2833916110cbe8e9a07e9f4c1f (patch) | |
tree | d25de6f2bcfa4b6cabe1fd55a1b8f508005de4c1 /build/config/utility.txx | |
parent | 729b56300c441a0d63c7d2013eb5a881211d352b (diff) |
Essential install module functionality
Diffstat (limited to 'build/config/utility.txx')
-rw-r--r-- | build/config/utility.txx | 24 |
1 files changed, 24 insertions, 0 deletions
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 <typename T> + void + append_options (cstrings& args, T& s, const char* var) + { + if (auto val = s[var]) + append_options (args, val.template as<const list_value&> (), var); + } + + template <typename T> + bool + find_option (const char* option, T& s, const char* var) + { + if (auto val = s[var]) + { + for (const name& n: val.template as<const list_value&> ()) + { + if (n.simple () && n.value == option) + return true; + } + } + + return false; + } } } |