Chromium Code Reviews| Index: tools/gn/function_set_defaults.cc |
| diff --git a/tools/gn/function_set_defaults.cc b/tools/gn/function_set_defaults.cc |
| index 7f26b4455c9f4a8dde2b9f349bd0de7566631dfc..ff64f1661effb46bb065c7282aa89aa178ab623d 100644 |
| --- a/tools/gn/function_set_defaults.cc |
| +++ b/tools/gn/function_set_defaults.cc |
| @@ -13,37 +13,36 @@ const char kSetDefaults[] = "set_defaults"; |
| const char kSetDefaults_HelpShort[] = |
| "set_defaults: Set default values for a target type."; |
| const char kSetDefaults_Help[] = |
| - "set_defaults: Set default values for a target type.\n" |
| - "\n" |
| - " set_defaults(<target_type_name>) { <values...> }\n" |
| - "\n" |
| - " Sets the default values for a given target type. Whenever\n" |
| - " target_type_name is seen in the future, the values specified in\n" |
| - " set_default's block will be copied into the current scope.\n" |
| - "\n" |
| - " When the target type is used, the variable copying is very strict.\n" |
| - " If a variable with that name is already in scope, the build will fail\n" |
| - " with an error.\n" |
| - "\n" |
| - " set_defaults can be used for built-in target types (\"executable\",\n" |
| - " \"shared_library\", etc.) and custom ones defined via the \"template\"\n" |
| - " command. It can be called more than once and the most recent call in\n" |
| - " any scope will apply, but there is no way to refer to the previous\n" |
| - " defaults and modify them (each call to set_defaults must supply a\n" |
| - " complete list of all defaults it wants). If you want to share\n" |
| - " defaults, store them in a separate variable.\n" |
| - "\n" |
| - "Example\n" |
| - "\n" |
| - " set_defaults(\"static_library\") {\n" |
| - " configs = [ \"//tools/mything:settings\" ]\n" |
| - " }\n" |
| - "\n" |
| - " static_library(\"mylib\")\n" |
| - " # The configs will be auto-populated as above. You can remove it if\n" |
| - " # you don't want the default for a particular default:\n" |
| - " configs -= \"//tools/mything:settings\"\n" |
| - " }\n"; |
| + R"(set_defaults: Set default values for a target type. |
| + |
| + set_defaults(<target_type_name>) { <values...> } |
| + |
| + Sets the default values for a given target type. Whenever target_type_name is |
| + seen in the future, the values specified in set_default's block will be |
| + copied into the current scope. |
| + |
| + When the target type is used, the variable copying is very strict. If a |
| + variable with that name is already in scope, the build will fail with an |
| + error. |
| + |
| + set_defaults can be used for built-in target types ("executable", |
| + "shared_library", etc.) and custom ones defined via the "template" command. |
| + It can be called more than once and the most recent call in any scope will |
| + apply, but there is no way to refer to the previous defaults and modify them |
| + (each call to set_defaults must supply a complete list of all defaults it |
| + wants). If you want to share defaults, store them in a separate variable. |
| + |
| +Example |
| + |
| + set_defaults("static_library") { |
| + configs = [ "//tools/mything:settings" ] |
| + } |
| + |
| + static_library("mylib") |
| + # The configs will be auto-populated as above. You can remove it if |
| + # you don't want the default for a particular default: |
| + configs -= [ "//tools/mything:settings" ] |
| + })"; |
|
scottmg
2016/11/08 00:30:30
here
|
| Value RunSetDefaults(Scope* scope, |
| const FunctionCallNode* function, |