diff options
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; + } } } |