OLD | NEW |
1 # GN Reference | 1 # GN Reference |
2 | 2 |
3 *This page is automatically generated from* `gn help --markdown all`. | 3 *This page is automatically generated from* `gn help --markdown all`. |
4 | 4 |
5 ## **\--args**: Specifies build arguments overrides. | 5 ## **\--args**: Specifies build arguments overrides. |
6 | 6 |
7 ``` | 7 ``` |
8 See "gn help buildargs" for an overview of how build arguments work. | 8 See "gn help buildargs" for an overview of how build arguments work. |
9 | 9 |
10 Most operations take a build directory. The build arguments are taken | 10 Most operations take a build directory. The build arguments are taken |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 and builds everything. | 729 and builds everything. |
730 | 730 |
731 ``` | 731 ``` |
732 | 732 |
733 ### **QtCreator Flags** | 733 ### **QtCreator Flags** |
734 | 734 |
735 ``` | 735 ``` |
736 --root-target=<target_name> | 736 --root-target=<target_name> |
737 Name of the root target for which the QtCreator project will be | 737 Name of the root target for which the QtCreator project will be |
738 generated to contain files of it and its dependencies. If unset, | 738 generated to contain files of it and its dependencies. If unset, |
739 the whole build graph will be omitted. | 739 the whole build graph will be emitted. |
740 | 740 |
741 | 741 |
742 ``` | 742 ``` |
743 | 743 |
744 ### **Eclipse IDE Support** | 744 ### **Eclipse IDE Support** |
745 | 745 |
746 ``` | 746 ``` |
747 GN DOES NOT generate Eclipse CDT projects. Instead, it generates a | 747 GN DOES NOT generate Eclipse CDT projects. Instead, it generates a |
748 settings file which can be imported into an Eclipse CDT project. The | 748 settings file which can be imported into an Eclipse CDT project. The |
749 XML file contains a list of include paths and defines. Because GN does | 749 XML file contains a list of include paths and defines. Because GN does |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1411 they are computed from all "bundle_data" target this one depends on | 1411 they are computed from all "bundle_data" target this one depends on |
1412 transitively (the recursion stops at "create_bundle" targets). | 1412 transitively (the recursion stops at "create_bundle" targets). |
1413 | 1413 |
1414 The "bundle_*_dir" properties must be defined. They will be used for | 1414 The "bundle_*_dir" properties must be defined. They will be used for |
1415 the expansion of {{bundle_*_dir}} rules in "bundle_data" outputs. | 1415 the expansion of {{bundle_*_dir}} rules in "bundle_data" outputs. |
1416 | 1416 |
1417 This target can be used on all platforms though it is designed only to | 1417 This target can be used on all platforms though it is designed only to |
1418 generate iOS/OS X bundle. In cross-platform projects, it is advised to | 1418 generate iOS/OS X bundle. In cross-platform projects, it is advised to |
1419 put it behind iOS/Mac conditionals. | 1419 put it behind iOS/Mac conditionals. |
1420 | 1420 |
| 1421 If a create_bundle is specified as a data_deps for another target, the |
| 1422 bundle is considered a leaf, and its public and private dependencies |
| 1423 will not contribute to any data or data_deps. Required runtime |
| 1424 dependencies should be placed in the bundle. A create_bundle can |
| 1425 declare its own explicit data and data_deps, however. |
| 1426 |
1421 ``` | 1427 ``` |
1422 | 1428 |
1423 ### **Variables** | 1429 ### **Variables** |
1424 | 1430 |
1425 ``` | 1431 ``` |
1426 bundle_root_dir*, bundle_resources_dir*, bundle_executable_dir*, | 1432 bundle_root_dir*, bundle_resources_dir*, bundle_executable_dir*, |
1427 bundle_plugins_dir*, deps, data_deps, public_deps, visibility, | 1433 bundle_plugins_dir*, deps, data_deps, public_deps, visibility, |
1428 product_type | 1434 product_type |
1429 * = required | 1435 * = required |
1430 | 1436 |
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2551 Make a ".a" / ".lib" file. | 2557 Make a ".a" / ".lib" file. |
2552 | 2558 |
2553 If you only need the static library for intermediate results in the | 2559 If you only need the static library for intermediate results in the |
2554 build, you should consider a source_set instead since it will skip | 2560 build, you should consider a source_set instead since it will skip |
2555 the (potentially slow) step of creating the intermediate library file. | 2561 the (potentially slow) step of creating the intermediate library file. |
2556 | 2562 |
2557 ``` | 2563 ``` |
2558 | 2564 |
2559 ### **Variables** | 2565 ### **Variables** |
2560 | 2566 |
| 2567 ### **complete_static_lib** |
2561 ``` | 2568 ``` |
2562 Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, | 2569 Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, |
2563 asmflags, defines, include_dirs, ldflags, lib_dirs, libs, | 2570 asmflags, defines, include_dirs, ldflags, lib_dirs, libs, |
2564 precompiled_header, precompiled_source | 2571 precompiled_header, precompiled_source |
2565 Deps: data_deps, deps, public_deps | 2572 Deps: data_deps, deps, public_deps |
2566 Dependent configs: all_dependent_configs, public_configs | 2573 Dependent configs: all_dependent_configs, public_configs |
2567 General: check_includes, configs, data, inputs, output_name, | 2574 General: check_includes, configs, data, inputs, output_name, |
2568 output_extension, public, sources, testonly, visibility | 2575 output_extension, public, sources, testonly, visibility |
2569 | 2576 |
2570 | 2577 |
(...skipping 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4390 GN doesn't require data files to exist at build-time. So actions that | 4397 GN doesn't require data files to exist at build-time. So actions that |
4391 produce files that are in turn runtime dependencies can list those | 4398 produce files that are in turn runtime dependencies can list those |
4392 generated files both in the "outputs" list as well as the "data" | 4399 generated files both in the "outputs" list as well as the "data" |
4393 list. | 4400 list. |
4394 | 4401 |
4395 By convention, directories are listed with a trailing slash: | 4402 By convention, directories are listed with a trailing slash: |
4396 data = [ "test/data/" ] | 4403 data = [ "test/data/" ] |
4397 However, no verification is done on these so GN doesn't enforce this. | 4404 However, no verification is done on these so GN doesn't enforce this. |
4398 The paths are just rebased and passed along when requested. | 4405 The paths are just rebased and passed along when requested. |
4399 | 4406 |
| 4407 Note: On iOS and OS X, create_bundle targets will not be recursed |
| 4408 into when gathering data. See "gn help create_bundle" for details. |
| 4409 |
4400 See "gn help runtime_deps" for how these are used. | 4410 See "gn help runtime_deps" for how these are used. |
4401 | 4411 |
4402 | 4412 |
4403 ``` | 4413 ``` |
4404 ## **data_deps**: Non-linked dependencies. | 4414 ## **data_deps**: Non-linked dependencies. |
4405 | 4415 |
4406 ``` | 4416 ``` |
4407 A list of target labels. | 4417 A list of target labels. |
4408 | 4418 |
4409 Specifies dependencies of a target that are not actually linked into | 4419 Specifies dependencies of a target that are not actually linked into |
4410 the current target. Such dependencies will be built and will be | 4420 the current target. Such dependencies will be built and will be |
4411 available at runtime. | 4421 available at runtime. |
4412 | 4422 |
4413 This is normally used for things like plugins or helper programs that | 4423 This is normally used for things like plugins or helper programs that |
4414 a target needs at runtime. | 4424 a target needs at runtime. |
4415 | 4425 |
| 4426 Note: On iOS and OS X, create_bundle targets will not be recursed |
| 4427 into when gathering data_deps. See "gn help create_bundle" for |
| 4428 details. |
| 4429 |
4416 See also "gn help deps" and "gn help data". | 4430 See also "gn help deps" and "gn help data". |
4417 | 4431 |
4418 ``` | 4432 ``` |
4419 | 4433 |
4420 ### **Example** | 4434 ### **Example** |
4421 | 4435 |
4422 ``` | 4436 ``` |
4423 executable("foo") { | 4437 executable("foo") { |
4424 deps = [ "//base" ] | 4438 deps = [ "//base" ] |
4425 data_deps = [ "//plugins:my_runtime_plugin" ] | 4439 data_deps = [ "//plugins:my_runtime_plugin" ] |
(...skipping 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6028 ** \--root**: Explicitly specify source root. | 6042 ** \--root**: Explicitly specify source root. |
6029 ** \--runtime-deps-list-file**: Save runtime dependencies for targets in file. | 6043 ** \--runtime-deps-list-file**: Save runtime dependencies for targets in file. |
6030 ** \--script-executable**: Set the executable used to execute scripts. | 6044 ** \--script-executable**: Set the executable used to execute scripts. |
6031 ** \--threads**: Specify number of worker threads. | 6045 ** \--threads**: Specify number of worker threads. |
6032 ** \--time**: Outputs a summary of how long everything took. | 6046 ** \--time**: Outputs a summary of how long everything took. |
6033 ** \--tracelog**: Writes a Chrome-compatible trace log to the given file. | 6047 ** \--tracelog**: Writes a Chrome-compatible trace log to the given file. |
6034 ** -v**: Verbose logging. | 6048 ** -v**: Verbose logging. |
6035 ** \--version**: Prints the GN version number and exits. | 6049 ** \--version**: Prints the GN version number and exits. |
6036 | 6050 |
6037 ``` | 6051 ``` |
OLD | NEW |