aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-09-30 15:15:04 -0400
committerXavier Claessens <xclaesse@gmail.com>2021-09-30 17:49:15 -0400
commit4deeb907b613760754c5be20e1af019d76b78515 (patch)
treee29d9a39b91576c7e0c80b8fdbb15b8c69488e83 /docs
parentd5b0673079728225f8dbfb7e0f9a5b18f04ffd73 (diff)
downloadmeson-4deeb907b613760754c5be20e1af019d76b78515.zip
meson-4deeb907b613760754c5be20e1af019d76b78515.tar.gz
meson-4deeb907b613760754c5be20e1af019d76b78515.tar.bz2
dependency: Allow searching for multiple names
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Reference-manual.md9
-rw-r--r--docs/markdown/snippets/dependency_names.md8
2 files changed, 16 insertions, 1 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index a91fa3e..0139bec 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -496,7 +496,7 @@ keyword arguments:
### dependency()
``` meson
- dependency_object dependency(*dependency_name*, ...)
+ dependency_object dependency(*name1*, *name2*, ...)
```
Finds an external dependency (usually a library installed on your
@@ -506,6 +506,13 @@ frameworks (OSX only) and [library-specific fallback detection
logic](Dependencies.md#dependencies-with-custom-lookup-functionality)
are also supported.
+*Since 0.60.0* more than one name can be provided, they will be tried in order
+and the first name to be found will be used. The fallback subproject will be
+used only if none of the names are found on the system. Once one of the name has
+been found, all other names are added into the cache so subsequent calls for any
+of those name will return the same value. This is useful in case a dependency
+could have different names, such as `png` and `libpng`.
+
Dependencies can also be resolved in two other ways:
* if the same name was used in a `meson.override_dependency` prior to
diff --git a/docs/markdown/snippets/dependency_names.md b/docs/markdown/snippets/dependency_names.md
new file mode 100644
index 0000000..3ea1019
--- /dev/null
+++ b/docs/markdown/snippets/dependency_names.md
@@ -0,0 +1,8 @@
+## Dependencies with multiple names
+
+More than one name can now be passed to `dependency()`, they will be tried in order
+and the first name to be found will be used. The fallback subproject will be
+used only if none of the names are found on the system. Once one of the name has
+been found, all other names are added into the cache so subsequent calls for any
+of those name will return the same value. This is useful in case a dependency
+could have different names, such as `png` and `libpng`.