aboutsummaryrefslogtreecommitdiff
path: root/build/config
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-07-02 08:01:42 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-07-02 08:01:42 +0200
commit39623df224608e77b5a62dabd35b09783198bc87 (patch)
tree3da359b809055fa737faec8d72d9ed1844e5c447 /build/config
parentd236d61ee9821abc4e8d3e3928ac2dfa9cb57d98 (diff)
Various improvements to cli module
Diffstat (limited to 'build/config')
-rw-r--r--build/config/utility18
1 files changed, 18 insertions, 0 deletions
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 <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;
+ }
}
}