OLD | NEW |
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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 At least half of the warnings in these blocks are already disabled | 477 At least half of the warnings in these blocks are already disabled |
478 globally (we added more global ones later). From the command line, do: | 478 globally (we added more global ones later). From the command line, do: |
479 | 479 |
480 ``` | 480 ``` |
481 $ cd src/build/config | 481 $ cd src/build/config |
482 $ git grep 4018 | 482 $ git grep 4018 |
483 compiler/BUILD.gn: "/wd4018", # Comparing signed and unsigned values. | 483 compiler/BUILD.gn: "/wd4018", # Comparing signed and unsigned values. |
484 ``` | 484 ``` |
485 | 485 |
486 tells us that warning 4018 is already disabled globally from the | 486 tells us that warning 4018 is already disabled globally from the |
487 `//build/config/compiler:default_warnings` config, and the same for | 487 `default_warning_flags` variable in `//build/config/compiler`, and the same |
488 4244. So ignore these. | 488 for 4244. So ignore these. |
489 | 489 |
490 Always comment what the warning is. Use your favorite search engine and | 490 Always comment what the warning is. Use your favorite search engine and |
491 type "vc warning 4267" to look it up. You'll end up with: | 491 type "vc warning 4267" to look it up. You'll end up with: |
492 | 492 |
493 ``` | 493 ``` |
494 if (is_win) { | 494 if (is_win) { |
495 cflags += [ | 495 cflags += [ |
496 "/wd4267", # Conversion from size_t to 'type'. | 496 "/wd4267", # Conversion from size_t to 'type'. |
497 ] | 497 ] |
498 } | 498 } |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 | 643 |
644 ``` | 644 ``` |
645 import("//mojo/public/tools/bindings/mojom.gni") | 645 import("//mojo/public/tools/bindings/mojom.gni") |
646 | 646 |
647 mojom("mojo_bindings") { | 647 mojom("mojo_bindings") { |
648 sources = [ | 648 sources = [ |
649 "foo.mojom", | 649 "foo.mojom", |
650 ] | 650 ] |
651 } | 651 } |
652 ``` | 652 ``` |
OLD | NEW |