aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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`
+```