aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-12-17 21:02:31 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2018-12-17 21:03:57 +0530
commitd42a3ae05ffb0495ccff913b9b759e3ad6bd92d1 (patch)
tree22f68751684e81cb6ddeb8aefd490d74a6fdf261
parentb4347ca4a98b148ba7f7908c3d96f393294df122 (diff)
downloadmeson-d42a3ae05ffb0495ccff913b9b759e3ad6bd92d1.zip
meson-d42a3ae05ffb0495ccff913b9b759e3ad6bd92d1.tar.gz
meson-d42a3ae05ffb0495ccff913b9b759e3ad6bd92d1.tar.bz2
Document dependency().name() added in 0.48 [skip ci]
Closes https://github.com/mesonbuild/meson/issues/3351
-rw-r--r--docs/markdown/Reference-manual.md4
-rw-r--r--docs/markdown/Release-notes-for-0.48.0.md21
2 files changed, 25 insertions, 0 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index bd73678..0625f96 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.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
diff --git a/docs/markdown/Release-notes-for-0.48.0.md b/docs/markdown/Release-notes-for-0.48.0.md
index 270a689..80fc08b 100644
--- a/docs/markdown/Release-notes-for-0.48.0.md
+++ b/docs/markdown/Release-notes-for-0.48.0.md
@@ -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`
+```