Skylib module containing convenience interfaces for select().
load("@bazel_skylib//lib:selects.bzl", "selects") selects.config_setting_group(<a href="#selects.config_setting_group-name">name</a>, <a href="#selects.config_setting_group-match_any">match_any</a>, <a href="#selects.config_setting_group-match_all">match_all</a>, <a href="#selects.config_setting_group-visibility">visibility</a>)
Matches if all or any of its member config_settings match.
Example:
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
load("@bazel_skylib//lib:selects.bzl", "selects") selects.with_or(<a href="#selects.with_or-input_dict">input_dict</a>, <a href="#selects.with_or-no_match_error">no_match_error</a>)
Drop-in replacement for select() that supports ORed keys.
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.
PARAMETERS
RETURNS
A native select() that expands
("//configs:two", "//configs:three"): [":dep2or3"]
to
"//configs:two": [":dep2or3"], "//configs:three": [":dep2or3"],
load("@bazel_skylib//lib:selects.bzl", "selects") selects.with_or_dict(<a href="#selects.with_or_dict-input_dict">input_dict</a>)
Variation of with_or that returns the dict of the select().
Unlike select(), the contents of the dict can be inspected by Starlark macros.
PARAMETERS
| Name | Description | Default Value |
|---|---|---|
| input_dict | Same as with_or. | none |
RETURNS
A dictionary usable by a native select().