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

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

Issue 1772213002: Create doc on build arg best practices for Blimp. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix markdown syntax error. Created 4 years, 9 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
« no previous file with comments | « blimp/docs/build.md ('k') | tools/gn/docs/style_guide.md » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # GN Quick Start guide 1 # GN Quick Start guide
2 2
3 [TOC] 3 [TOC]
4 4
5 ## Running GN 5 ## Running GN
6 6
7 You just run `gn` from the command line. There is a script in 7 You just run `gn` from the command line. There is a script in
8 depot\_tools (which is presumably on your path) with this name. The 8 depot\_tools (which is presumably on your path) with this name. The
9 script will find the binary in the source tree containing the current 9 script will find the binary in the source tree containing the current
10 directory and run it. 10 directory and run it.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 target_cpu = "arm" 66 target_cpu = "arm"
67 target_cpu = "x86" 67 target_cpu = "x86"
68 target_cpu = "x64" 68 target_cpu = "x64"
69 ``` 69 ```
70 70
71 See [GNCrossCompiles](cross_compiles.md) for more info. 71 See [GNCrossCompiles](cross_compiles.md) for more info.
72 72
73 ## Configuring goma 73 ## Configuring goma
74 74
75
76 Run `gn args out/Default` (substituting your build directory as needed). 75 Run `gn args out/Default` (substituting your build directory as needed).
77 Add: 76 Add:
78 77
79 ``` 78 ```
80 use_goma = true 79 use_goma = true
81 goma_dir = "~/foo/bar/goma" 80 goma_dir = "~/foo/bar/goma"
82 ``` 81 ```
83 82
84 If your goma is in the default location (`~/goma`) then you can omit the 83 If your goma is in the default location (`~/goma`) then you can omit the
85 `goma_dir` line. 84 `goma_dir` line.
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 274
276 ``` 275 ```
277 > ninja -C out/Default say_hello 276 > ninja -C out/Default say_hello
278 ninja: Entering directory 'out/Default' 277 ninja: Entering directory 'out/Default'
279 [1/1] Regenerating ninja files 278 [1/1] Regenerating ninja files
280 [4/4] LINK say_hello 279 [4/4] LINK say_hello
281 > out/Default/say_hello 280 > out/Default/say_hello
282 Hello, Bill and Joy. 281 Hello, Bill and Joy.
283 ``` 282 ```
284 283
284 ## Add a new build argument
285
286 You declare which arguments you accept and specify default values via
287 `declare_args`.
288
289 ```
290 declare_args() {
291 enable_teleporter = true
292 enable_doom_melon = false
293 }
294 ```
295
296 See `gn help buildargs` for an overview of how this works.
297 See `gn help declare_args` for specifics on declaring them.
298
299 It is an error to declare a given argument more than once in a given scope, so
300 care should be used in scoping and naming arguments.
301
285 ## Don't know what's going on? 302 ## Don't know what's going on?
286 303
287 You can run GN in verbose mode to see lots of messages about what it's 304 You can run GN in verbose mode to see lots of messages about what it's
288 doing. Use `-v` for this. 305 doing. Use `-v` for this.
289 306
290 ### Print debugging 307 ### Print debugging
291 308
292 There is a `print` command which just writes to stdout: 309 There is a `print` command which just writes to stdout:
293 310
294 ``` 311 ```
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 line flag. This will output a summary of timings for various things. 357 line flag. This will output a summary of timings for various things.
341 358
342 You can also make a trace of how the build files were executed: 359 You can also make a trace of how the build files were executed:
343 360
344 ``` 361 ```
345 gn --tracelog=mylog.trace 362 gn --tracelog=mylog.trace
346 ``` 363 ```
347 364
348 and you can load the resulting file in Chrome's `about:tracing` page to 365 and you can load the resulting file in Chrome's `about:tracing` page to
349 look at everything. 366 look at everything.
OLDNEW
« no previous file with comments | « blimp/docs/build.md ('k') | tools/gn/docs/style_guide.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698