From 39623df224608e77b5a62dabd35b09783198bc87 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 2 Jul 2015 08:01:42 +0200 Subject: Various improvements to cli module --- build/config/utility | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'build/config/utility') diff --git a/build/config/utility b/build/config/utility index e59f0e5..c2209e4 100644 --- a/build/config/utility +++ b/build/config/utility @@ -63,6 +63,24 @@ namespace build } } } + + // Check if a specified option is present. T is either target or scope. + // + 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