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 2125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2136 Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, | 2136 Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, |
2137 asmflags, defines, include_dirs, ldflags, lib_dirs, libs, | 2137 asmflags, defines, include_dirs, ldflags, lib_dirs, libs, |
2138 precompiled_header, precompiled_source | 2138 precompiled_header, precompiled_source |
2139 Deps: data_deps, deps, public_deps | 2139 Deps: data_deps, deps, public_deps |
2140 Dependent configs: all_dependent_configs, public_configs | 2140 Dependent configs: all_dependent_configs, public_configs |
2141 General: check_includes, configs, data, inputs, output_name, | 2141 General: check_includes, configs, data, inputs, output_name, |
2142 output_extension, public, sources, testonly, visibility | 2142 output_extension, public, sources, testonly, visibility |
2143 | 2143 |
2144 | 2144 |
2145 ``` | 2145 ``` |
| 2146 ## **pool**: Defines a pool object. |
| 2147 |
| 2148 ``` |
| 2149 Pool objects can be applied to a tool to limit the parallelism of the |
| 2150 build. This object has a single property "depth" corresponding to |
| 2151 the number of tasks that may run simultaneously. |
| 2152 |
| 2153 As the file containing the pool definition may be executed in the |
| 2154 of more than one toolchain it is recommended to specify an explicit |
| 2155 toolchain when definining and referencing a pool. |
| 2156 |
| 2157 A pool is referenced by its label just like a target. |
| 2158 |
| 2159 ``` |
| 2160 |
| 2161 ### **Variables** |
| 2162 |
| 2163 ``` |
| 2164 depth* |
| 2165 * = required |
| 2166 |
| 2167 ``` |
| 2168 |
| 2169 ### **Example** |
| 2170 |
| 2171 ``` |
| 2172 if (current_toolchain == default_toolchain) { |
| 2173 pool("link_pool") { |
| 2174 depth = 1 |
| 2175 } |
| 2176 } |
| 2177 |
| 2178 toolchain("toolchain") { |
| 2179 tool("link") { |
| 2180 command = "..." |
| 2181 pool = ":link_pool($default_toolchain)") |
| 2182 } |
| 2183 } |
| 2184 |
| 2185 |
| 2186 ``` |
2146 ## **print**: Prints to the console. | 2187 ## **print**: Prints to the console. |
2147 | 2188 |
2148 ``` | 2189 ``` |
2149 Prints all arguments to the console separated by spaces. A newline is | 2190 Prints all arguments to the console separated by spaces. A newline is |
2150 automatically appended to the end. | 2191 automatically appended to the end. |
2151 | 2192 |
2152 This function is intended for debugging. Note that build files are run | 2193 This function is intended for debugging. Note that build files are run |
2153 in parallel so you may get interleaved prints. A buildfile may also | 2194 in parallel so you may get interleaved prints. A buildfile may also |
2154 be executed more than once in parallel in the context of different | 2195 be executed more than once in parallel in the context of different |
2155 toolchains so the prints from one file may be duplicated or | 2196 toolchains so the prints from one file may be duplicated or |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2906 ] | 2947 ] |
2907 | 2948 |
2908 Example for a linker tool that produces a .dll and a .lib. The | 2949 Example for a linker tool that produces a .dll and a .lib. The |
2909 use of {{target_output_name}}, {{output_extension}} and | 2950 use of {{target_output_name}}, {{output_extension}} and |
2910 {{output_dir}} allows the target to override these values. | 2951 {{output_dir}} allows the target to override these values. |
2911 outputs = [ | 2952 outputs = [ |
2912 "{{output_dir}}/{{target_output_name}}{{output_extension}}", | 2953 "{{output_dir}}/{{target_output_name}}{{output_extension}}", |
2913 "{{output_dir}}/{{target_output_name}}.lib", | 2954 "{{output_dir}}/{{target_output_name}}.lib", |
2914 ] | 2955 ] |
2915 | 2956 |
| 2957 pool [label, optional] |
| 2958 |
| 2959 Label of the pool to use for the tool. Pools are used to limit |
| 2960 the number of tasks that can execute concurrently during the |
| 2961 build. |
| 2962 |
| 2963 See also "gn help pool". |
| 2964 |
2916 link_output [string with substitutions] | 2965 link_output [string with substitutions] |
2917 depend_output [string with substitutions] | 2966 depend_output [string with substitutions] |
2918 runtime_link_output [string with substitutions] | 2967 runtime_link_output [string with substitutions] |
2919 Valid for: "solink" only (optional) | 2968 Valid for: "solink" only (optional) |
2920 | 2969 |
2921 These three files specify which of the outputs from the solink | 2970 These three files specify which of the outputs from the solink |
2922 tool should be used for linking and dependency tracking. These | 2971 tool should be used for linking and dependency tracking. These |
2923 should match entries in the "outputs". If unspecified, the | 2972 should match entries in the "outputs". If unspecified, the |
2924 first item in the "outputs" array will be used for all. See | 2973 first item in the "outputs" array will be used for all. See |
2925 "Separate linking and dependencies for shared libraries" | 2974 "Separate linking and dependencies for shared libraries" |
(...skipping 3116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6042 ** \--root**: Explicitly specify source root. | 6091 ** \--root**: Explicitly specify source root. |
6043 ** \--runtime-deps-list-file**: Save runtime dependencies for targets in file. | 6092 ** \--runtime-deps-list-file**: Save runtime dependencies for targets in file. |
6044 ** \--script-executable**: Set the executable used to execute scripts. | 6093 ** \--script-executable**: Set the executable used to execute scripts. |
6045 ** \--threads**: Specify number of worker threads. | 6094 ** \--threads**: Specify number of worker threads. |
6046 ** \--time**: Outputs a summary of how long everything took. | 6095 ** \--time**: Outputs a summary of how long everything took. |
6047 ** \--tracelog**: Writes a Chrome-compatible trace log to the given file. | 6096 ** \--tracelog**: Writes a Chrome-compatible trace log to the given file. |
6048 ** -v**: Verbose logging. | 6097 ** -v**: Verbose logging. |
6049 ** \--version**: Prints the GN version number and exits. | 6098 ** \--version**: Prints the GN version number and exits. |
6050 | 6099 |
6051 ``` | 6100 ``` |
OLD | NEW |