Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # GN Language and Operation | 1 # GN Language and Operation |
| 2 | 2 |
| 3 [TOC] | 3 [TOC] |
| 4 | 4 |
| 5 ## Introduction | 5 ## Introduction |
| 6 | 6 |
| 7 This page describes many of the language details and behaviors. | 7 This page describes many of the language details and behaviors. |
| 8 | 8 |
| 9 ### Use the built-in help! | 9 ### Use the built-in help! |
| 10 | 10 |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 369 other targets. The built-in target types (see `gn help <targettype>` for | 369 other targets. The built-in target types (see `gn help <targettype>` for |
| 370 more help) are: | 370 more help) are: |
| 371 | 371 |
| 372 * `action`: Run a script to generate a file. | 372 * `action`: Run a script to generate a file. |
| 373 * `action_foreach`: Run a script once for each source file. | 373 * `action_foreach`: Run a script once for each source file. |
| 374 * `component`: Configurable to be another type of library. | 374 * `component`: Configurable to be another type of library. |
| 375 * `executable`: Generates an executable file. | 375 * `executable`: Generates an executable file. |
| 376 * `group`: A virtual dependency node that refers to one or more other | 376 * `group`: A virtual dependency node that refers to one or more other |
| 377 targets. | 377 targets. |
| 378 * `shared_library`: A .dll or .so. | 378 * `shared_library`: A .dll or .so. |
| 379 * `loadable_module`: An .so loadable only at runtime. | |
|
brettw
2015/10/13 23:13:32
Can you write ".dll or .so"
Bons
2015/10/13 23:30:52
Done.
| |
| 379 * `source_set`: A lightweight virtual static library (usually | 380 * `source_set`: A lightweight virtual static library (usually |
| 380 preferrable over a real static library since it will build faster). | 381 preferrable over a real static library since it will build faster). |
| 381 * `static_library`: A .lib or .a file (normally you'll want a | 382 * `static_library`: A .lib or .a file (normally you'll want a |
| 382 source\_set instead). | 383 `source_set` instead). |
| 383 | 384 |
| 384 You can extend this to make custom target types using templates (see below). | 385 You can extend this to make custom target types using templates (see below). |
| 385 | 386 |
| 386 ## Configs | 387 ## Configs |
| 387 | 388 |
| 388 Configs are named objects that specify sets of flags, include | 389 Configs are named objects that specify sets of flags, include |
| 389 directories, and defines. They can be applied to a target and pushed to | 390 directories, and defines. They can be applied to a target and pushed to |
| 390 dependent targets. | 391 dependent targets. |
| 391 | 392 |
| 392 To define a config: | 393 To define a config: |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 725 settings which work a bit differently in Blaze. This is partially to | 726 settings which work a bit differently in Blaze. This is partially to |
| 726 make conversion from the existing GYP code easier, and the GYP | 727 make conversion from the existing GYP code easier, and the GYP |
| 727 constructs generally offer more fine-grained control (which is either | 728 constructs generally offer more fine-grained control (which is either |
| 728 good or bad, depending on the situation). | 729 good or bad, depending on the situation). |
| 729 | 730 |
| 730 GN also uses GYP names like "sources" instead of "srcs" since | 731 GN also uses GYP names like "sources" instead of "srcs" since |
| 731 abbreviating this seems needlessly obscure, although it uses Blaze's | 732 abbreviating this seems needlessly obscure, although it uses Blaze's |
| 732 "deps" since "dependencies" is so hard to type. Chromium also compiles | 733 "deps" since "dependencies" is so hard to type. Chromium also compiles |
| 733 multiple languages in one target so specifying the language type on the | 734 multiple languages in one target so specifying the language type on the |
| 734 target name prefix was dropped (e.g. from `cc_library`). | 735 target name prefix was dropped (e.g. from `cc_library`). |
| OLD | NEW |