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

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

Issue 1397143003: [GN]: Enable PCH for WebKit on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « third_party/WebKit/Source/platform/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # GYP->GN Conversion Cookbook 1 # GYP->GN Conversion Cookbook
2 2
3 [TOC] 3 [TOC]
4 4
5 ## Targets 5 ## Targets
6 6
7 | *GYP* | *GN* | 7 | *GYP* | *GN* |
8 |:-------------------------------------------------|:--------------------------- ------------------------| 8 |:-------------------------------------------------|:--------------------------- ------------------------|
9 | `'type': 'static_library', 'name': 'foo',` | `static_library("foo") {` o r `source_set("foo") {` | 9 | `'type': 'static_library', 'name': 'foo',` | `static_library("foo") {` o r `source_set("foo") {` |
10 | `'type': 'shared_library', 'name': 'foo',` | `shared_library("foo") {` | 10 | `'type': 'shared_library', 'name': 'foo',` | `shared_library("foo") {` |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 'defines': [ 431 'defines': [
432 'FOO', 432 'FOO',
433 ], 433 ],
434 }, 434 },
435 ``` 435 ```
436 436
437 Note that many of the includes are trying to add the root "src" 437 Note that many of the includes are trying to add the root "src"
438 directory to the include path. This is always present in GN so you can 438 directory to the include path. This is always present in GN so you can
439 remove these. 439 remove these.
440 440
441 GYP also requires you do duplicate these settings, once for the target 441 GYP also requires you to duplicate these settings, once for the target
442 itself, and once for the direct/all dependent settings. In GN, 442 itself, and once for the direct/all dependent settings. In GN,
443 public/all dependent configs also apply to the current target so you 443 public/all dependent configs also apply to the current target so you
444 only need to specify it once. 444 only need to specify it once.
445 445
446 In GN, put the settings in a config (declared above your target), and 446 In GN, put the settings in a config (declared above your target), and
447 then reference that as a public config in your target: 447 then reference that as a public config in your target:
448 448
449 ``` 449 ```
450 config("foo_config") { 450 config("foo_config") {
451 include_dirs = [ "." ] 451 include_dirs = [ "." ]
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 642
643 ``` 643 ```
644 import("//mojo/public/tools/bindings/mojom.gni") 644 import("//mojo/public/tools/bindings/mojom.gni")
645 645
646 mojom("mojo_bindings") { 646 mojom("mojo_bindings") {
647 sources = [ 647 sources = [
648 "foo.mojom", 648 "foo.mojom",
649 ] 649 ]
650 } 650 }
651 ``` 651 ```
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698