Skip to content

Commit

Permalink
Update common_settings.bzl (#552)
Browse files Browse the repository at this point in the history
add scope attr to string_setting
  • Loading branch information
aranguyen authored Nov 6, 2024
1 parent e853fd4 commit 505e1bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/common_settings_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ A string list-typed build setting that cannot be set on the command line
## string_setting

<pre>
string_setting(<a href="#string_setting-name">name</a>, <a href="#string_setting-make_variable">make_variable</a>, <a href="#string_setting-values">values</a>)
string_setting(<a href="#string_setting-name">name</a>, <a href="#string_setting-make_variable">make_variable</a>, <a href="#string_setting-scope">scope</a>, <a href="#string_setting-values">values</a>)
</pre>

A string-typed build setting that cannot be set on the command line
Expand All @@ -162,6 +162,7 @@ A string-typed build setting that cannot be set on the command line
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="string_setting-name"></a>name | A unique name for this target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | |
| <a id="string_setting-make_variable"></a>make_variable | If set, the build setting's value will be available as a Make variable with this name in the attributes of rules that list this build setting in their 'toolchains' attribute. | String | optional | `""` |
| <a id="string_setting-scope"></a>scope | The scope indicates where a flag can propagate to | String | optional | `"universal"` |
| <a id="string_setting-values"></a>values | The list of allowed values for this setting. An error is raised if any other value is given. | List of strings | optional | `[]` |


Expand Down
4 changes: 4 additions & 0 deletions rules/common_settings.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ string_setting = rule(
doc = "The list of allowed values for this setting. An error is raised if any other value is given.",
),
"make_variable": _MAKE_VARIABLE_ATTR,
"scope": attr.string(
doc = "The scope indicates where a flag can propagate to",
default = "universal",
),
},
doc = "A string-typed build setting that cannot be set on the command line",
)

0 comments on commit 505e1bc

Please sign in to comment.