From 478c7104f82895be4e33e139616956455fddc7b6 Mon Sep 17 00:00:00 2001 From: Vaibhav Nagarnaik Date: Wed, 1 Jun 2022 20:11:46 +0000 Subject: [PATCH] hypervisor: Update Cargo.toml dependencies The `haxm` implementation depends on `win_util` and `winapi` crates which are only required on Windows. The `tempfile` crate is used in testing. Move `kvm` and `kvm_sys` dependencies for non-windows builds. BUG=b:213151459 TEST=Compiled on linux. Change-Id: I55b8ee4ac5da953a17e8bdd063e5ed488e3f53f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3684929 Tested-by: kokoro Commit-Queue: Vaibhav Nagarnaik Reviewed-by: Daniel Verkamp --- hypervisor/Cargo.toml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/hypervisor/Cargo.toml b/hypervisor/Cargo.toml index 6423ea460b..fb4148b6f8 100644 --- a/hypervisor/Cargo.toml +++ b/hypervisor/Cargo.toml @@ -4,6 +4,9 @@ version = "0.1.0" authors = ["The Chromium OS Authors"] edition = "2021" +[features] +haxm = [] + [dependencies] bit_field = { path = "../bit_field" } bitflags = "1" @@ -11,8 +14,6 @@ data_model = { path = "../common/data_model" } downcast-rs = "1.2.0" enumn = "0.1.0" fnv = "1" -kvm = { path = "../kvm" } -kvm_sys = { path = "../kvm_sys" } libc = "*" memoffset = "0.6" serde = { version = "1", features = [ "derive" ] } @@ -20,5 +21,13 @@ sync = { path = "../common/sync" } base = { path = "../base" } vm_memory = { path = "../vm_memory" } -[features] -haxm = [] +[target.'cfg(unix)'.dependencies] +kvm = { path = "../kvm" } +kvm_sys = { path = "../kvm_sys" } + +[target.'cfg(windows)'.dependencies] +winapi = "*" +win_util = { path = "../win_util" } + +[target.'cfg(windows)'.dev-dependencies] +tempfile = "*"