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

Side by Side Diff: tools/gn/docs/reference.md

Issue 1907613002: GN flag to fail for unused build args. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 # GN Reference 1 # GN Reference
2 2
3 *This page is automatically generated from* `gn help --markdown all`. 3 *This page is automatically generated from* `gn help --markdown all`.
4 4
5 ## **\--args**: Specifies build arguments overrides. 5 ## **\--args**: Specifies build arguments overrides.
6 6
7 ``` 7 ```
8 See "gn help buildargs" for an overview of how build arguments work. 8 See "gn help buildargs" for an overview of how build arguments work.
9 9
10 Most operations take a build directory. The build arguments are taken 10 Most operations take a build directory. The build arguments are taken
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 ``` 63 ```
64 Normally GN loads the ".gn"file from the source root for some basic 64 Normally GN loads the ".gn"file from the source root for some basic
65 configuration (see "gn help dotfile"). This flag allows you to 65 configuration (see "gn help dotfile"). This flag allows you to
66 use a different file. 66 use a different file.
67 67
68 Note that this interacts with "--root" in a possibly incorrect way. 68 Note that this interacts with "--root" in a possibly incorrect way.
69 It would be nice to test the edge cases and document or fix. 69 It would be nice to test the edge cases and document or fix.
70 70
71 71
72 ``` 72 ```
73 ## **\--markdown**: write the output in the Markdown format. 73 ## **\--fail-on-unused-args**: Treat unused build args as fatal errors.
74
75 ```
76 If you set a value in a build's "gn args" and never use it in the
77 build (in a declare_args() block), GN will normally print an error
78 but not fail the build.
79
80 In many cases engineers would use build args to enable or disable
81 features that would sometimes get removed. It would by annoying to
82 block work for typically benign problems. In Chrome in particular,
83 flags might be configured for build bots in a separate infrastructure
84 repository, or a declare_args block might be changed in a third party
85 repository. Treating these errors as blocking forced complex multi-
86 way patches to land what would otherwise be simple changes.
87
88 In some cases, such concerns are not as important, and a mismatch
89 in build flags between the invoker of the build and the build files
90 represents a critical mismatch that should be immediately fixed. Such
91 users can set this flag to force GN to fail in that case.
92
93
94 ```
95 ## **\--markdown**: Write help output in the Markdown format.
74 96
75 ## **\--[no]color**: Forces colored output on or off. 97 ## **\--[no]color**: Forces colored output on or off.
76 98
77 ``` 99 ```
78 Normally GN will try to detect whether it is outputting to a terminal 100 Normally GN will try to detect whether it is outputting to a terminal
79 and will enable or disable color accordingly. Use of these switches 101 and will enable or disable color accordingly. Use of these switches
80 will override the default. 102 will override the default.
81 103
82 ``` 104 ```
83 105
(...skipping 5834 matching lines...) Expand 10 before | Expand all | Expand 10 after
5918 **Available global switches 5940 **Available global switches
5919 ** Do "gn help --the_switch_you_want_help_on" for more. Individual 5941 ** Do "gn help --the_switch_you_want_help_on" for more. Individual
5920 commands may take command-specific switches not listed here. See the 5942 commands may take command-specific switches not listed here. See the
5921 help on your specific command for more. 5943 help on your specific command for more.
5922 5944
5923 ``` 5945 ```
5924 5946
5925 ** \--args**: Specifies build arguments overrides. 5947 ** \--args**: Specifies build arguments overrides.
5926 ** \--color**: Force colored output. 5948 ** \--color**: Force colored output.
5927 ** \--dotfile**: Override the name of the ".gn" file. 5949 ** \--dotfile**: Override the name of the ".gn" file.
5928 ** \--markdown**: write the output in the Markdown format. 5950 ** \--fail-on-unused-args**: Treat unused build args as fatal errors.
5951 ** \--markdown**: Write help output in the Markdown format.
5929 ** \--nocolor**: Force non-colored output. 5952 ** \--nocolor**: Force non-colored output.
5930 ** -q**: Quiet mode. Don't print output on success. 5953 ** -q**: Quiet mode. Don't print output on success.
5931 ** \--root**: Explicitly specify source root. 5954 ** \--root**: Explicitly specify source root.
5932 ** \--runtime-deps-list-file**: Save runtime dependencies for targets in file. 5955 ** \--runtime-deps-list-file**: Save runtime dependencies for targets in file.
5933 ** \--threads**: Specify number of worker threads. 5956 ** \--threads**: Specify number of worker threads.
5934 ** \--time**: Outputs a summary of how long everything took. 5957 ** \--time**: Outputs a summary of how long everything took.
5935 ** \--tracelog**: Writes a Chrome-compatible trace log to the given file. 5958 ** \--tracelog**: Writes a Chrome-compatible trace log to the given file.
5936 ** -v**: Verbose logging. 5959 ** -v**: Verbose logging.
5937 ** \--version**: Prints the GN version number and exits. 5960 ** \--version**: Prints the GN version number and exits.
5938 5961
5939 ``` 5962 ```
OLDNEW
« no previous file with comments | « tools/gn/args.cc ('k') | tools/gn/setup.cc » ('j') | tools/gn/setup.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698