1<!-- Generated with Stardoc: http://skydoc.bazel.build --> 2 3<a name="#selects.with_or"></a> 4 5## selects.with_or 6 7<pre> 8selects.with_or(<a href="#selects.with_or-input_dict">input_dict</a>, <a href="#selects.with_or-no_match_error">no_match_error</a>) 9</pre> 10 11Drop-in replacement for `select()` that supports ORed keys. 12 13Example: 14 15 ```build 16 deps = selects.with_or({ 17 "//configs:one": [":dep1"], 18 ("//configs:two", "//configs:three"): [":dep2or3"], 19 "//configs:four": [":dep4"], 20 "//conditions:default": [":default"] 21 }) 22 ``` 23 24 Key labels may appear at most once anywhere in the input. 25 26 27### Parameters 28 29<table class="params-table"> 30 <colgroup> 31 <col class="col-param" /> 32 <col class="col-description" /> 33 </colgroup> 34 <tbody> 35 <tr id="selects.with_or-input_dict"> 36 <td><code>input_dict</code></td> 37 <td> 38 required. 39 <p> 40 The same dictionary `select()` takes, except keys may take 41 either the usual form `"//foo:config1"` or 42 `("//foo:config1", "//foo:config2", ...)` to signify 43 `//foo:config1` OR `//foo:config2` OR `...`. 44 </p> 45 </td> 46 </tr> 47 <tr id="selects.with_or-no_match_error"> 48 <td><code>no_match_error</code></td> 49 <td> 50 optional. default is <code>""</code> 51 <p> 52 Optional custom error to report if no condition matches. 53 </p> 54 </td> 55 </tr> 56 </tbody> 57</table> 58 59 60<a name="#selects.with_or_dict"></a> 61 62## selects.with_or_dict 63 64<pre> 65selects.with_or_dict(<a href="#selects.with_or_dict-input_dict">input_dict</a>) 66</pre> 67 68Variation of `with_or` that returns the dict of the `select()`. 69 70Unlike `select()`, the contents of the dict can be inspected by Starlark 71macros. 72 73 74### Parameters 75 76<table class="params-table"> 77 <colgroup> 78 <col class="col-param" /> 79 <col class="col-description" /> 80 </colgroup> 81 <tbody> 82 <tr id="selects.with_or_dict-input_dict"> 83 <td><code>input_dict</code></td> 84 <td> 85 required. 86 <p> 87 Same as `with_or`. 88 </p> 89 </td> 90 </tr> 91 </tbody> 92</table> 93 94 95<a name="#selects.config_setting_group"></a> 96 97## selects.config_setting_group 98 99<pre> 100selects.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>) 101</pre> 102 103Matches if all or any of its member `config_setting`s match. 104 105Example: 106 107 ```build 108 config_setting(name = "one", define_values = {"foo": "true"}) 109 config_setting(name = "two", define_values = {"bar": "false"}) 110 config_setting(name = "three", define_values = {"baz": "more_false"}) 111 112 config_setting_group( 113 name = "one_two_three", 114 match_all = [":one", ":two", ":three"] 115 ) 116 117 cc_binary( 118 name = "myapp", 119 srcs = ["myapp.cc"], 120 deps = select({ 121 ":one_two_three": [":special_deps"], 122 "//conditions:default": [":default_deps"] 123 }) 124 ``` 125 126 127### Parameters 128 129<table class="params-table"> 130 <colgroup> 131 <col class="col-param" /> 132 <col class="col-description" /> 133 </colgroup> 134 <tbody> 135 <tr id="selects.config_setting_group-name"> 136 <td><code>name</code></td> 137 <td> 138 required. 139 <p> 140 The group's name. This is how `select()`s reference it. 141 </p> 142 </td> 143 </tr> 144 <tr id="selects.config_setting_group-match_any"> 145 <td><code>match_any</code></td> 146 <td> 147 optional. default is <code>[]</code> 148 <p> 149 A list of `config_settings`. This group matches if *any* member 150 in the list matches. If this is set, `match_all` must not be set. 151 </p> 152 </td> 153 </tr> 154 <tr id="selects.config_setting_group-match_all"> 155 <td><code>match_all</code></td> 156 <td> 157 optional. default is <code>[]</code> 158 <p> 159 A list of `config_settings`. This group matches if *every* 160 member in the list matches. If this is set, `match_any` must be not 161 set. 162 </p> 163 </td> 164 </tr> 165 </tbody> 166</table> 167 168 169