aboutsummaryrefslogtreecommitdiff
path: root/build/config/utility
diff options
context:
space:
mode:
Diffstat (limited to 'build/config/utility')
-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;
+ }
}
}