Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Unified Diff: tools/gn/function_set_defaults.cc

Issue 2481423002: Convert gn docstrings to C++11 raw strings. (Closed)
Patch Set: Fixes Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/function_set_default_toolchain.cc ('k') | tools/gn/function_template.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a2a14afcc7d95e9f2ed000c4a08b1fb117f55803 100644
--- a/tools/gn/function_set_defaults.cc
+++ b/tools/gn/function_set_defaults.cc
@@ -13,37 +13,37 @@ 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" ]
+ }
+)";
Value RunSetDefaults(Scope* scope,
const FunctionCallNode* function,
« no previous file with comments | « tools/gn/function_set_default_toolchain.cc ('k') | tools/gn/function_template.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698