diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 09c95a1..5f961d1 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -18,8 +18,9 @@ markdown = { version = "=1.0.0", optional = true } [build-dependencies] [features] -default = ["vhost-device-sound", "vhost-device-scmi"] +default = ["vhost-device-sound", "vhost-device-scmi", "vhost-device-scsi"] vhost-device-scmi = [] +vhost-device-scsi = [] vhost-device-sound = ["vhost-device-sound-alsa", "vhost-device-sound-pipewire"] vhost-device-sound-alsa = ["mangen"] vhost-device-sound-pipewire = ["mangen"] diff --git a/xtask/README.md b/xtask/README.md index e4a30f0..d9a8d66 100644 --- a/xtask/README.md +++ b/xtask/README.md @@ -22,3 +22,4 @@ The following crates have manual pages built by default: - [`vhost-device-sound`](../vhost-device-sound), enabled by the default feature `vhost-device-sound`. - It can further be fine-tuned with the features `vhost-device-sound-pipewire` and `vhost-device-sound-alsa`. - [`vhost-device-scmi`](../vhost-device-scmi), enabled by the default feature `vhost-device-scmi`. +- [`vhost-device-scsi`](../vhost-device-scsi), enabled by the default feature `vhost-device-scsi`. diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 70beec1..f2e610a 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -34,6 +34,12 @@ mod vhost_device_sound; #[path = "../../vhost-device-scmi/src/args.rs"] mod vhost_device_scmi; +// Use vhost-device-scsi's args module as our own using the #[path] attribute + +#[cfg(feature = "vhost-device-scsi")] +#[path = "../../vhost-device-scsi/src/args.rs"] +mod vhost_device_scsi; + fn main() { if let Err(err) = run_app() { eprintln!("{err}"); @@ -193,6 +199,14 @@ fn mangen() -> Result<(), Box> { let man_path = dist_dir.join("vhost-device-scmi.1"); buffers.push((man_path, buffer)); } + #[cfg(feature = "vhost-device-scsi")] + { + use vhost_device_scsi::ScsiArgs; + + let buffer = mangen_for_crate::(workspace_dir.join("vhost-device-scsi"))?; + let man_path = dist_dir.join("vhost-device-scsi.1"); + buffers.push((man_path, buffer)); + } if buffers.is_empty() { println!("No manpages were generated! Try using the correct xtask cargo features.");