summaryrefslogtreecommitdiff
path: root/docs/markdown
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2024-06-22 10:59:05 -0500
committerJussi Pakkanen <jpakkane@gmail.com>2024-06-23 15:10:42 +0300
commit9be6e653d49957c974af2c171257cbaf942abbb9 (patch)
tree788b00fc4997ec587ccc64e21cba1b7d7f030dc1 /docs/markdown
parenta111c28ecef721af960721c26b40f4e5108760c7 (diff)
downloadmeson-9be6e653d49957c974af2c171257cbaf942abbb9.tar.gz
find_program: add a kwarg to specify custom version argument
When trying to get the version of a program, meson was previously hardcoded to run the binary with `--version`. This does work with the vast majority of programs, but there are a few outliers (e.g. ffmpeg) which have an unusual argument for printing out the version. Support these programs by introducing a version_argument kwarg in find_program which allows users to override `--version` with whatever the custom argument for printing the version may be for the program.
Diffstat (limited to 'docs/markdown')
-rw-r--r--docs/markdown/snippets/find_program_version_argument.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/markdown/snippets/find_program_version_argument.md b/docs/markdown/snippets/find_program_version_argument.md
new file mode 100644
index 000000000..99fe62109
--- /dev/null
+++ b/docs/markdown/snippets/find_program_version_argument.md
@@ -0,0 +1,12 @@
+## New version_argument kwarg for find_program
+
+When finding an external program with `find_program`, the `version_argument`
+can be used to override the default `--version` argument when trying to parse
+the version of the program.
+
+For example, if the following is used:
+```meson
+foo = find_program('foo', version_argument: '-version')
+```
+
+meson will internally run `foo -version` when trying to find the version of `foo`.