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

Unified Diff: tools/gn/docs/reference.md

Issue 2936923002: Add not_needed function (Closed)
Patch Set: Rebase Created 3 years, 6 months 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 | « no previous file | tools/gn/functions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/docs/reference.md
diff --git a/tools/gn/docs/reference.md b/tools/gn/docs/reference.md
index b6eccc822fd348877352dd3e3a5dddd21ca61868..de924a7cb38703ed3817e060695a076fad741903 100644
--- a/tools/gn/docs/reference.md
+++ b/tools/gn/docs/reference.md
@@ -42,6 +42,7 @@
* [get_target_outputs: [file list] Get the list of outputs from a target.](#get_target_outputs)
* [getenv: Get an environment variable.](#getenv)
* [import: Import a file into the current scope.](#import)
+ * [not_needed: Mark variables from scope as not needed.](#not_needed)
* [pool: Defines a pool object.](#pool)
* [print: Prints to the console.](#print)
* [process_file_template: Do template expansion over a list of files.](#process_file_template)
@@ -2137,6 +2138,25 @@
# Looks in the current directory.
import("my_vars.gni")
```
+### <a name="not_needed"></a>**not_needed**: Mark variables from scope as not needed.
+
+```
+ not_needed(variable_list_or_star, variable_to_ignore_list = [])
+ not_needed(from_scope, variable_list_or_star,
+ variable_to_ignore_list = [])
+
+ Mark the variables in the current or given scope as not needed, which means
+ you will not get an error about unused variables for these.
+```
+
+#### **Example**
+
+```
+ not_needed("*", [ "config" ])
+ not_needed([ "data_deps", "deps" ])
+ not_needed(invoker, "*", [ "config" ])
+ not_needed(invoker, [ "data_deps", "deps" ])
+```
### <a name="pool"></a>**pool**: Defines a pool object.
```
« no previous file with comments | « no previous file | tools/gn/functions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698