summaryrefslogtreecommitdiff
path: root/docs/markdown/Rust-module.md
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-11-18 12:28:36 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2025-12-22 12:01:05 +0100
commit8d2676a49bdce134e3ee9d97f00e627b442dfa40 (patch)
tree432fbce714395f6a36278095b4318fa54704d25d /docs/markdown/Rust-module.md
parentc2cbb7001129ee92d966f5060fbf0459eaa29550 (diff)
downloadmeson-8d2676a49bdce134e3ee9d97f00e627b442dfa40.tar.gz
modules: rust: add package.override_dependency method
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'docs/markdown/Rust-module.md')
-rw-r--r--docs/markdown/Rust-module.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/markdown/Rust-module.md b/docs/markdown/Rust-module.md
index 5ee7b7da9..0c576ece6 100644
--- a/docs/markdown/Rust-module.md
+++ b/docs/markdown/Rust-module.md
@@ -416,6 +416,33 @@ Builds a proc-macro crate for a workspace package.
Accepts all keyword arguments from [[shared_library]].
+#### package.override_dependency()
+
+```meson
+pkg.override_dependency(dep[, rust_abi: abi])
+```
+
+Keyword arguments:
+- `rust_abi`: (`str`, optional) The ABI to use for the dependency. Valid values are
+ `'rust'`, `'c'`, or `'proc-macro'`; the value must match the crate types and is
+ mandatory if more than one ABI is exposed by the crate.
+
+Make the crate available as a dependency to other crates. This is the same
+as calling `meson.override_dependency`, but it computes the correct dependency
+name from `pkg`'s name, API version and ABI (Rust vs. C).
+
+It is typically used with `library() or `proc_macro()`, for example:
+
+```meson
+lib_pkg = cargo_ws.package('myproject-lib')
+lib = lib_pkg.library(install: false)
+lib_pkg.override_dependency(declare_dependency(link_with: lib))
+
+# Declares myproject-lib as a dependency in Cargo.toml
+exe_pkg = cargo_ws.package()
+exe_pkg.executable(install: true)
+```
+
#### package.executable()
```meson