From 505e1bc3aaae8375f857637f78bf6b3dd953862a Mon Sep 17 00:00:00 2001 From: Ara Nguyen <91614797+aranguyen@users.noreply.github.com> Date: Wed, 6 Nov 2024 17:52:21 -0500 Subject: [PATCH] Update common_settings.bzl (#552) add scope attr to string_setting --- docs/common_settings_doc.md | 3 ++- rules/common_settings.bzl | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/common_settings_doc.md b/docs/common_settings_doc.md index 83be443..b5fdd0b 100755 --- a/docs/common_settings_doc.md +++ b/docs/common_settings_doc.md @@ -150,7 +150,7 @@ A string list-typed build setting that cannot be set on the command line ## string_setting
-string_setting(name, make_variable, values)
+string_setting(name, make_variable, scope, values)
 
A string-typed build setting that cannot be set on the command line @@ -162,6 +162,7 @@ A string-typed build setting that cannot be set on the command line | :------------- | :------------- | :------------- | :------------- | :------------- | | name | A unique name for this target. | Name | required | | | 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 | `""` | +| scope | The scope indicates where a flag can propagate to | String | optional | `"universal"` | | values | The list of allowed values for this setting. An error is raised if any other value is given. | List of strings | optional | `[]` | diff --git a/rules/common_settings.bzl b/rules/common_settings.bzl index 5776d8d..aba40c2 100644 --- a/rules/common_settings.bzl +++ b/rules/common_settings.bzl @@ -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", )