rust: allow using build-root bindings.rs from cargo
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 12 Nov 2024 10:52:23 +0000 (11:52 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 10 Dec 2024 17:44:06 +0000 (18:44 +0100)
commitcb7ada5409f171dae364f206a7fe3ff30fcba7cb
tree5fc025795b5e9db9902ff0b1590b768f937c241b
parent8c2866750319fac3f7b641d1a097f3779952631d
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>
meson.build
rust/hw/char/pl011/.gitignore [deleted file]
rust/qemu-api/.gitignore
rust/qemu-api/README.md
rust/qemu-api/build.rs
rust/qemu-api/meson.build
rust/qemu-api/src/bindings.rs [new file with mode: 0644]
rust/qemu-api/src/lib.rs