aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown
diff options
context:
space:
mode:
Diffstat (limited to 'docs/markdown')
-rw-r--r--docs/markdown/Reference-manual.md7
-rw-r--r--docs/markdown/snippets/as_link_whole.md12
2 files changed, 19 insertions, 0 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index 01052b0..c289397 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -2426,6 +2426,13 @@ an external dependency with the following methods:
the value of `include_type` to `value`. The `value` argument is optional and
defaults to `'preserve'`.
+ - `as_link_whole()` *Since 0.56.0* Only dependencies created with
+ `declare_dependency()`, returns a copy of the dependency object with all
+ link_with arguments changed to link_whole. This is useful for example for
+ fallback dependency from a subproject built with `default_library=static`.
+ Note that all `link_with` objects must be static libraries otherwise an error
+ will be raised when trying to `link_whole` a shared library.
+
- `partial_dependency(compile_args : false, link_args : false, links
: false, includes : false, sources : false)` *(since 0.46.0)*: returns
a new dependency object with the same name, version, found status,
diff --git a/docs/markdown/snippets/as_link_whole.md b/docs/markdown/snippets/as_link_whole.md
new file mode 100644
index 0000000..39f1289
--- /dev/null
+++ b/docs/markdown/snippets/as_link_whole.md
@@ -0,0 +1,12 @@
+## `dep.as_link_whole()`
+
+Dependencies created with `declare_dependency()` now has new method `as_link_whole()`.
+It returns a copy of the dependency object with all link_with arguments changed
+to link_whole. This is useful for example for fallback dependency from a
+subproject built with `default_library=static`.
+
+```meson
+somelib = static_library('somelib', ...)
+dep = declare_dependency(..., link_with: somelib)
+library('someotherlib', ..., dependencies: dep.as_link_whole())
+```