summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-10-29 09:36:33 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2025-12-22 12:01:05 +0100
commit8c88a12e508161244704efc1685d0ea8ddb8fcd5 (patch)
treef007895d8a61f9eddb089743926ceb2fea6731fe /docs
parente6c89d7209ccdf1e6e176a1667e0a9ab045703bd (diff)
downloadmeson-8c88a12e508161244704efc1685d0ea8ddb8fcd5.tar.gz
modules: rust: add package.executable
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Rust-module.md27
1 files changed, 21 insertions, 6 deletions
diff --git a/docs/markdown/Rust-module.md b/docs/markdown/Rust-module.md
index 7ad9f1cfd..50e4854ca 100644
--- a/docs/markdown/Rust-module.md
+++ b/docs/markdown/Rust-module.md
@@ -274,12 +274,7 @@ Example usage:
rustmod = import('rust')
cargo_ws = rustmod.workspace()
pkg = cargo_ws.package()
-
-executable('my_app', 'src/main.rs',
- dependencies: pkg.dependencies(),
- rust_args: pkg.rust_args(),
- rust_dependency_map: pkg.rust_dependency_map(),
-)
+pkg.executable(install: true)
```
### workspace.subproject()
@@ -411,6 +406,26 @@ Builds a proc-macro crate for a workspace package.
Accepts all keyword arguments from [[shared_library]].
+#### package.executable()
+
+```meson
+exe = pkg.executable([target_name], [sources], ...)
+```
+
+Builds an executable target for a workspace package. The method requires that the
+package has at least one `bin` section defined in its `Cargo.toml` file,
+or one binary discovered from the contents of the file system.
+
+Positional arguments:
+- `target_name`: (`str`, optional) Name of the binary target to build. If the package
+ has multiple `bin` sections in `Cargo.toml`, this argument is required and must
+ match one of the binary names. If omitted and there's only one binary, that binary
+ will be built automatically.
+- `sources`: (`StructuredSources`, optional) Source files for the executable. If omitted,
+ uses the path specified in the corresponding `bin` section of `Cargo.toml`.
+
+Accepts all keyword arguments from [[executable]].
+
### Subprojects only
#### subproject.dependency()