| Index: tools/gn/docs/cookbook.md
|
| diff --git a/tools/gn/docs/cookbook.md b/tools/gn/docs/cookbook.md
|
| index c918d86448b74c8883ec35d7241d7599c66e9265..c32856349a1e32db3feed0c906e5cbbd589f2b10 100644
|
| --- a/tools/gn/docs/cookbook.md
|
| +++ b/tools/gn/docs/cookbook.md
|
| @@ -64,7 +64,7 @@ action("foo") {
|
| args = [ "--la_dee_da" ]
|
| }
|
|
|
| -executable('foo.exe') {
|
| +executable("foo.exe") {
|
| ...
|
| deps = [ ":foo" ] # Depend on the action to make sure it runs.
|
| }
|
| @@ -73,6 +73,36 @@ executable('foo.exe') {
|
| Rules in GYP become `action_foreach` in GN which work like actions but
|
| iterate over a set of sources.
|
|
|
| +### Copies
|
| +
|
| +GYP
|
| +
|
| +```
|
| +'copies': [
|
| + {
|
| + 'destination': '<(PRODUCT_DIR)/',
|
| + 'files': [
|
| + '../build/win/dbghelp_xp/dbghelp.dll',
|
| + ],
|
| + },
|
| +],
|
| +```
|
| +
|
| +Unlike GYP, where copies are part of a target, GN copies are
|
| +separate targets that you then depend on via deps from other targets:
|
| +
|
| +```
|
| +copy("bar") {
|
| + sources = [ "../path/to/secret.dll" ]
|
| + outputs = [ "$root_out_dir/{{source_file_part}}" ]
|
| +}
|
| +
|
| +component("base") {
|
| + ...
|
| + deps = [ "bar" } # Depend on the copy to make sure it runs.
|
| +}
|
| +```
|
| +
|
| ## Platform checking
|
|
|
| | *GYP* | *GN* |
|
|
|