Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: tools/gn/docs/reference.md

Issue 1904473002: Add arflags to GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/gn/config_values_generator.cc ('k') | tools/gn/function_toolchain.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2985 matching lines...) Expand 10 before | Expand all | Expand 10 after
2996 2996
2997 {{source_gen_dir}} 2997 {{source_gen_dir}}
2998 {{source_out_dir}} 2998 {{source_out_dir}}
2999 The directory in the generated file and output directories, 2999 The directory in the generated file and output directories,
3000 respectively, for the current input file. If the source file 3000 respectively, for the current input file. If the source file
3001 is in the same directory as the target is declared in, they will 3001 is in the same directory as the target is declared in, they will
3002 will be the same as the "target" versions above. 3002 will be the same as the "target" versions above.
3003 Example: "gen/base/test" 3003 Example: "gen/base/test"
3004 3004
3005 Linker tools have multiple inputs and (potentially) multiple outputs 3005 Linker tools have multiple inputs and (potentially) multiple outputs
3006 The static library tool ("alink") is not considered a linker tool.
3006 The following expansions are available: 3007 The following expansions are available:
3007 3008
3008 {{inputs}} 3009 {{inputs}}
3009 {{inputs_newline}} 3010 {{inputs_newline}}
3010 Expands to the inputs to the link step. This will be a list of 3011 Expands to the inputs to the link step. This will be a list of
3011 object files and static libraries. 3012 object files and static libraries.
3012 Example: "obj/foo.o obj/bar.o obj/somelibrary.a" 3013 Example: "obj/foo.o obj/bar.o obj/somelibrary.a"
3013 3014
3014 The "_newline" version will separate the input files with 3015 The "_newline" version will separate the input files with
3015 newlines instead of spaces. This is useful in response files: 3016 newlines instead of spaces. This is useful in response files:
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
3055 3056
3056 {{solibs}} 3057 {{solibs}}
3057 Extra libraries from shared library dependencide not specified 3058 Extra libraries from shared library dependencide not specified
3058 in the {{inputs}}. This is the list of link_output files from 3059 in the {{inputs}}. This is the list of link_output files from
3059 shared libraries (if the solink tool specifies a "link_output" 3060 shared libraries (if the solink tool specifies a "link_output"
3060 variable separate from the "depend_output"). 3061 variable separate from the "depend_output").
3061 3062
3062 These should generally be treated the same as libs by your tool. 3063 These should generally be treated the same as libs by your tool.
3063 Example: "libfoo.so libbar.so" 3064 Example: "libfoo.so libbar.so"
3064 3065
3066 The static library ("alink") tool allows {{arflags}} plus the common
3067 tool substitutions.
3068
3065 The copy tool allows the common compiler/linker substitutions, plus 3069 The copy tool allows the common compiler/linker substitutions, plus
3066 {{source}} which is the source of the copy. The stamp tool allows 3070 {{source}} which is the source of the copy. The stamp tool allows
3067 only the common tool substitutions. 3071 only the common tool substitutions.
3068 3072
3069 The copy_bundle_data and compile_xcassets tools only allows the common 3073 The copy_bundle_data and compile_xcassets tools only allows the common
3070 tool substitutions. Both tools are required to create iOS/OS X bundles 3074 tool substitutions. Both tools are required to create iOS/OS X bundles
3071 and need only be defined on those platforms. 3075 and need only be defined on those platforms.
3072 3076
3073 The copy_bundle_data tool will be called with one source and needs to 3077 The copy_bundle_data tool will be called with one source and needs to
3074 copy (optionally optimizing the data representation) to its output. It 3078 copy (optionally optimizing the data representation) to its output. It
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
3718 # Sources here can include headers from a despite lack of deps. 3722 # Sources here can include headers from a despite lack of deps.
3719 ... 3723 ...
3720 } 3724 }
3721 3725
3722 group("a_b_shared_deps") { 3726 group("a_b_shared_deps") {
3723 public_deps = [ ":c" ] 3727 public_deps = [ ":c" ]
3724 } 3728 }
3725 3729
3726 3730
3727 ``` 3731 ```
3732 ## **arflags**: Arguments passed to static_library archiver.
3733
3734 ```
3735 A list of flags passed to the archive/lib command that creates static
3736 libraries.
3737
3738 arflags are NOT pushed to dependents, so applying arflags to source
3739 sets or any other target type will be a no-op. As with ldflags,
3740 you could put the arflags in a config and set that as a public or
3741 "all dependent" config, but that will likely not be what you want.
3742 If you have a chain of static libraries dependent on each other,
3743 this can cause the flags to propagate up to other static libraries.
3744 Due to the nature of how arflags are typically used, you will normally
3745 want to apply them directly on static_library targets themselves.
3746
3747 ```
3748
3749 ### **Ordering of flags and values**
3750
3751 ```
3752 1. Those set on the current target (not in a config).
3753 2. Those set on the "configs" on the target in order that the
3754 configs appear in the list.
3755 3. Those set on the "all_dependent_configs" on the target in order
3756 that the configs appear in the list.
3757 4. Those set on the "public_configs" on the target in order that
3758 those configs appear in the list.
3759 5. all_dependent_configs pulled from dependencies, in the order of
3760 the "deps" list. This is done recursively. If a config appears
3761 more than once, only the first occurance will be used.
3762 6. public_configs pulled from dependencies, in the order of the
3763 "deps" list. If a dependency is public, they will be applied
3764 recursively.
3765
3766
3767 ```
3728 ## **args**: Arguments passed to an action. 3768 ## **args**: Arguments passed to an action.
3729 3769
3730 ``` 3770 ```
3731 For action and action_foreach targets, args is the list of arguments 3771 For action and action_foreach targets, args is the list of arguments
3732 to pass to the script. Typically you would use source expansion (see 3772 to pass to the script. Typically you would use source expansion (see
3733 "gn help source_expansion") to insert the source file names. 3773 "gn help source_expansion") to insert the source file names.
3734 3774
3735 See also "gn help action" and "gn help action_foreach". 3775 See also "gn help action" and "gn help action_foreach".
3736 3776
3737 3777
(...skipping 2152 matching lines...) Expand 10 before | Expand all | Expand 10 after
5890 ** -q**: Quiet mode. Don't print output on success. 5930 ** -q**: Quiet mode. Don't print output on success.
5891 ** \--root**: Explicitly specify source root. 5931 ** \--root**: Explicitly specify source root.
5892 ** \--runtime-deps-list-file**: Save runtime dependencies for targets in file. 5932 ** \--runtime-deps-list-file**: Save runtime dependencies for targets in file.
5893 ** \--threads**: Specify number of worker threads. 5933 ** \--threads**: Specify number of worker threads.
5894 ** \--time**: Outputs a summary of how long everything took. 5934 ** \--time**: Outputs a summary of how long everything took.
5895 ** \--tracelog**: Writes a Chrome-compatible trace log to the given file. 5935 ** \--tracelog**: Writes a Chrome-compatible trace log to the given file.
5896 ** -v**: Verbose logging. 5936 ** -v**: Verbose logging.
5897 ** \--version**: Prints the GN version number and exits. 5937 ** \--version**: Prints the GN version number and exits.
5898 5938
5899 ``` 5939 ```
OLDNEW
« no previous file with comments | « tools/gn/config_values_generator.cc ('k') | tools/gn/function_toolchain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698