summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-10-28 18:16:05 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2025-12-22 12:01:05 +0100
commit8cd91e1eb4c76e79eba589674af08229b1e02f90 (patch)
treed661153b32867d1eccc3ef07bd4b28b070f8a164 /docs
parent29bbbf65fa7432d3cfc741feb55c6a76c2460e08 (diff)
downloadmeson-8cd91e1eb4c76e79eba589674af08229b1e02f90.tar.gz
modules: rust: add package.library/package.proc_macro methods
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Rust-module.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/markdown/Rust-module.md b/docs/markdown/Rust-module.md
index 1acb9324b..7ad9f1cfd 100644
--- a/docs/markdown/Rust-module.md
+++ b/docs/markdown/Rust-module.md
@@ -381,6 +381,36 @@ Keyword arguments:
- `dev_dependencies`: (`bool`, default: false) Whether to include development dependencies (not yet implemented)
- `system_dependencies`: (`bool`, default: true) Whether to include system dependencies
+#### package.library()
+
+```meson
+lib = pkg.library(...)
+```
+
+Builds library targets for a workspace package. The method requires that
+the package's `Cargo.toml` file contains the `[lib]` section or that it
+is discovered from the contents of the file system. Static vs. shared library is
+decided based on the crate types in `Cargo.toml`
+
+Positional arguments:
+- `target_name`: (`str`, optional) Name of the binary target to build.
+- `sources`: (`StructuredSources`, optional) Source files for the executable. If omitted,
+ uses the path specified in the `[lib]` section of `Cargo.toml`.
+
+Accepts all keyword arguments from [[shared_library]] and [[static_library]].
+`rust_abi` must match the crate types and is mandatory if more than one
+ABI is exposed by the crate.
+
+#### package.proc_macro()
+
+```meson
+lib = pkg.proc_macro(...)
+```
+
+Builds a proc-macro crate for a workspace package.
+
+Accepts all keyword arguments from [[shared_library]].
+
### Subprojects only
#### subproject.dependency()