Document dependency().name() added in 0.48 [skip ci]

Closes https://github.com/mesonbuild/meson/issues/3351
pull/4645/head
Nirbheek Chauhan 6 years ago
parent b4347ca4a9
commit d42a3ae05f
  1. 4
      docs/markdown/Reference-manual.md
  2. 21
      docs/markdown/Release-notes-for-0.48.0.md

@ -2070,6 +2070,10 @@ an external dependency with the following methods:
- `found()` which returns whether the dependency was found
- `name()` *(Added 0.48.0)* returns the name of the dependency that was
searched. Returns `internal` for dependencies created with
`declare_dependency()`.
- `get_pkgconfig_variable(varname)` *(Added 0.36.0)* will get the
pkg-config variable specified, or, if invoked on a non pkg-config
dependency, error out. *(Added 0.44.0)* You can also redefine a

@ -311,3 +311,24 @@ clone-recursive=true
This allows you to declare an optional subproject. You can now call `found()`
on the return value of the `subproject()` call to see if the subproject is
available before calling `get_variable()` to fetch information from it.
## `dependency()` objects now support the `.name()` method
You can now fetch the name of the dependency that was searched like so:
```meson
glib_dep = dependency('glib-2.0')
...
message("dependency name is " + glib_dep.name())
# This outputs `dependency name is glib-2.0`
qt_dep = dependency('qt5')
...
message("dependency name is " + qt_dep.name())
# This outputs `dependency name is qt5`
decl_dep = declare_dependency()
...
message("dependency name is " + decl_dep.name())
# This outputs `dependency name is internal`
```

Loading…
Cancel
Save