mirror of
https://github.com/rust-vmm/vhost-device.git
synced 2025-12-26 06:32:44 +00:00
Having all the workspace crates under the crates/ directory is unnecessary. Rust documentation itself recommends all crates to be in the root directory: https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html#creating-the-second-package-in-the-workspace I paste the text content here, in case the online page ever changes or becomes unavailable: ## Creating the Second Package in the Workspace Next, let’s create another member package in the workspace and call it add_one. Change the top-level Cargo.toml to specify the add_one path in the members list: Filename: Cargo.toml [workspace] members = [ "adder", "add_one", ] Then generate a new library crate named add_one: $ cargo new add_one --lib Created library `add_one` package Your add directory should now have these directories and files: ├── Cargo.lock ├── Cargo.toml ├── add_one │ ├── Cargo.toml │ └── src │ └── lib.rs ├── adder │ ├── Cargo.toml │ └── src │ └── main.rs └── target Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
30 lines
831 B
Rust
30 lines
831 B
Rust
// VIRTIO GPIO Emulation via vhost-user
|
|
//
|
|
// Copyright 2022 Linaro Ltd. All Rights Reserved.
|
|
// Viresh Kumar <viresh.kumar@linaro.org>
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0 or BSD-3-Clause
|
|
|
|
#[cfg(target_env = "gnu")]
|
|
mod backend;
|
|
#[cfg(target_env = "gnu")]
|
|
mod gpio;
|
|
#[cfg(all(target_env = "gnu", any(test, feature = "mock_gpio")))]
|
|
mod mock_gpio;
|
|
#[cfg(target_env = "gnu")]
|
|
mod vhu_gpio;
|
|
#[cfg(target_env = "gnu")]
|
|
mod virtio_gpio;
|
|
|
|
#[cfg(target_env = "gnu")]
|
|
fn main() {
|
|
backend::gpio_init()
|
|
}
|
|
|
|
// Rust vmm container (https://github.com/rust-vmm/rust-vmm-container) doesn't
|
|
// have tools to do a musl build at the moment, and adding that support is
|
|
// tricky as well to the container. Skip musl builds until the time pre-built
|
|
// libgpiod library is available for musl.
|
|
#[cfg(target_env = "musl")]
|
|
fn main() {}
|