vcs_tag()
This command detects revision control commit information at build time
and places it in the specified output file. This file is guaranteed to
be up to date on every build. Keywords are similar to custom_target().
Meson will read the contents of input, substitute the
replace_string with the detected revision number, and write the
result to output. This method returns a
custom_tgt object that (as usual) should be
used to signal dependencies if other targets use the file outputted
by this.
For example, if you generate a header with this and want to use that in a build target, you must add the return value to the sources of that build target. Without that, Meson will not know the order in which to build the targets.
If you desire more specific behavior than what this command provides,
you should use custom_target().
Signature
# This command detects revision control commit information at build time
custom_tgt vcs_tag(
command : array[exe | external_program | custom_tgt | file | str] # The command to execute, see custom_target() for details
fallback : str # Version number to use when no revision control information is present,
input : str [required] # File to modify (e
install : bool # When true, this generated file is installed during
install_dir : str # The subdirectory to install the generated file to (e
install_mode : array[str | int] # Specify the file mode in symbolic format
install_tag : str # A string used by the `meson install --tags` command
output : str [required] # File to write the results to (e
replace_string : str # String in the input file to substitute with the commit information
)
Arguments
The function vcs_tag()
accepts the following keyword arguments:
| Name | Type | Description | Tags |
|---|---|---|---|
command |
array[exe | external_program | custom_tgt | file | str] |
The command to execute, see This parameter is optional. If it is absent, Meson will try its best to find a suitable default command. (since 0.62.0) (since 0.63.0) |
|
fallback |
str |
Version number to use when no revision control information is present, such as when building from a release tarball. |
|
input |
str |
File to modify (e.g. |
|
install |
bool |
When true, this generated file is installed during
the install step, and |
(since 1.7.0)
|
install_dir |
str |
The subdirectory to install the generated file to (e.g. |
(since 1.7.0) |
install_mode |
array[str | int] |
Specify the file mode in symbolic format and optionally the owner/uid and group/gid for the installed files. See the |
(since 1.7.0) |
install_tag |
str |
A string used by the |
(since 1.7.0) |
output |
str |
File to write the results to (e.g. |
|
replace_string |
str |
String in the input file to substitute with the commit information. |
|
The results of the search are