qemu/rust/qemu-api/README.md
Paolo Bonzini cb7ada5409 rust: allow using build-root bindings.rs from cargo
Right now, using cargo with QEMU requires copying by hand the bindings.rs to the
source tree.  Instead, we can use an include file to escape the cage of cargo's
mandated source directory structure.

By running cargo within meson's "devenv" and adding a MESON_BUILD_ROOT
environment variable, it is easy for build.rs to find the file.  However, the
file must be symlinked into cargo's output directory for rust-analyzer to find
it.

Suggested-by: Junjie Mao <junjie.mao@hotmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-12-10 18:44:06 +01:00

17 lines
425 B
Markdown

# QEMU bindings and API wrappers
This library exports helper Rust types, Rust macros and C FFI bindings for internal QEMU APIs.
The C bindings can be generated with `bindgen`, using this build target:
```console
$ ninja bindings.inc.rs
```
## Generate Rust documentation
To generate docs for this crate, including private items:
```sh
pyvenv/bin/meson devenv -w ../rust cargo doc --no-deps --document-private-items
```