278e5ffeba
Using the same CARGO_TARGET_DIR for all builds prevents us from building for platforms in parallel, since cargo will lock the directory to only run one build at a time. Use the same directory for clippy as well, and ensure that clippy won't invalidate caches created by run_tests. This reduces the build time for tools/presubmit by about 50%. Another advantage is that rust_analyzer and run_tests will no longer block each other or invalidate the cache when run with different feature flags. Note: This introduces two subtle changes to the build that required nit fixes: - build.rs files are now run through clippy as well - common/* crates are now also built for the target architecture instead the host. BUG=None TEST=tools/presubmit Change-Id: I8da9ef53418c0b15827d512a04e77828621aef88 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3984416 Commit-Queue: Dennis Kempin <denniskempin@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> |
||
---|---|---|
.. | ||
src | ||
tests | ||
bindgen.sh | ||
build.rs | ||
Cargo.toml | ||
README.md |
Libvda Rust wrapper
Note: This crate is specific to ChromeOS and requires the native (libvda)[https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform2/arc/vm/libvda] library at link time.
Rust wrapper for libvda. This library is used to enable communication with Chrome's GPU process to perform hardware accelerated decoding and encoding. It is currently in development to be used by crosvm's virtio-video device.
Building for the host environment
You can also execute cargo
directly for faster build and tests. This would be useful when you are
developing this crate. Since this crate depends on libvda.so, you need to install it to host
environment first.
(chroot)$ sudo emerge chromeos-base/libvda # Install libvda.so to host.
# Build
(chroot)$ cargo build
# Unit tests
(chroot)$ cargo test
Updating generated bindings
src/bindings.rs
is automatically generated from libvda_common.h
. src/decode/bindings.rs
is
automatically generated from libvda_decode.h
. src/encode/bindings.rs
is automatically generated
from libvda_encode.h
.
See the header of the bindings file for the generation command.