mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-28 21:03:54 -06:00

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>
17 lines
425 B
Markdown
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
|
|
```
|