diff --git a/docs/selects_doc.md b/docs/selects_doc.md index e26ed4c..55711c9 100755 --- a/docs/selects_doc.md +++ b/docs/selects_doc.md @@ -1,3 +1,7 @@ + + + + ## selects.with_or
@@ -6,6 +10,20 @@ selects.with_or(input_dict, @@ -32,19 +50,6 @@ Drop-in replacement for `select()` that supports ORed keys. optional. default is""
Optional custom error to report if no condition matches. - - Example: - - ```build - deps = selects.with_or({ - "//configs:one": [":dep1"], - ("//configs:two", "//configs:three"): [":dep2or3"], - "//configs:four": [":dep4"], - "//conditions:default": [":default"] - }) - ``` - - Key labels may appear at most once anywhere in the input.
@@ -52,6 +57,8 @@ Drop-in replacement for `select()` that supports ORed keys. + + ## selects.with_or_dict@@ -85,3 +92,77 @@ macros. + + +## selects.config_setting_group + ++selects.config_setting_group(name, match_any, match_all) ++ +Matches if all or any of its member `config_setting`s match. + +Example: + + ```build + config_setting(name = "one", define_values = {"foo": "true"}) + config_setting(name = "two", define_values = {"bar": "false"}) + config_setting(name = "three", define_values = {"baz": "more_false"}) + + config_setting_group( + name = "one_two_three", + match_all = [":one", ":two", ":three"] + ) + + cc_binary( + name = "myapp", + srcs = ["myapp.cc"], + deps = select({ + ":one_two_three": [":special_deps"], + "//conditions:default": [":default_deps"] + }) + ``` + + +### Parameters + +
name |
+
+ required.
+ + The group's name. This is how `select()`s reference it. + + |
+
match_any |
+
+ optional. default is []
+ + A list of `config_settings`. This group matches if *any* member + in the list matches. If this is set, `match_all` must not be set. + + |
+
match_all |
+
+ optional. default is []
+ + A list of `config_settings`. This group matches if *every* + member in the list matches. If this is set, `match_any` must be not + set. + + |
+