| 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") {`
| |
| 11 | `'type': 'loadable_module', 'name': 'foo',` | `loadable_module("foo") {`
| |
| 11 | `'type': '<(component)', 'name': 'foo',` | `component("foo") {`
| | 12 | `'type': '<(component)', 'name': 'foo',` | `component("foo") {`
| |
| 12 | `'type': 'executable', 'name': 'foo',` | `executable("foo") {`
| | 13 | `'type': 'executable', 'name': 'foo',` | `executable("foo") {`
| |
| 13 | `'type': '<(gtest_target_type)', 'name': 'foo',` | `test("foo") {`
| | 14 | `'type': '<(gtest_target_type)', 'name': 'foo',` | `test("foo") {`
| |
| 14 | `'type': 'none', 'name': 'foo',` | `group("foo") {`
| | 15 | `'type': 'none', 'name': 'foo',` | `group("foo") {`
| |
| 15 | 16 |
| 16 ### Note on static libraries | 17 ### Note on static libraries |
| 17 | 18 |
| 18 A source\_set is basically a transparent static\_library. The source files | 19 A source\_set is basically a transparent static\_library. The source files |
| 19 are compiled with the given options but not linked into anything. | 20 are compiled with the given options but not linked into anything. |
| 20 Targets that depend on a source set get the source set's object files | 21 Targets that depend on a source set get the source set's object files |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 | 676 |
| 676 ``` | 677 ``` |
| 677 import("//mojo/public/tools/bindings/mojom.gni") | 678 import("//mojo/public/tools/bindings/mojom.gni") |
| 678 | 679 |
| 679 mojom("mojo_bindings") { | 680 mojom("mojo_bindings") { |
| 680 sources = [ | 681 sources = [ |
| 681 "foo.mojom", | 682 "foo.mojom", |
| 682 ] | 683 ] |
| 683 } | 684 } |
| 684 ``` | 685 ``` |
| OLD | NEW |