mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-25 05:03:05 +00:00
2131a614e5
As part of migrating to proto_build_tools, we've cleaned up some old code that was unused: * All of the ExternalProto tooling that was unused. * The vsock proto doesn't exist. BUG=b:256951877 TEST=builds Change-Id: I647395b4900d487179139050ab6750a464b528e7 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4021592 Reviewed-by: Vikram Auradkar <auradkar@google.com> Commit-Queue: Noah Gold <nkgold@google.com>
40 lines
1 KiB
Rust
40 lines
1 KiB
Rust
// Copyright 2019 The ChromiumOS Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
use std::env;
|
|
use std::error::Error;
|
|
use std::path::PathBuf;
|
|
|
|
type Result<T> = std::result::Result<T, Box<dyn Error>>;
|
|
|
|
struct LocalProto {
|
|
// Corresponding to the input file src/$module.proto.
|
|
module: &'static str,
|
|
}
|
|
|
|
static LOCAL_PROTOS: &[LocalProto] = &[
|
|
#[cfg(feature = "plugin")]
|
|
LocalProto { module: "plugin" },
|
|
#[cfg(feature = "composite-disk")]
|
|
LocalProto {
|
|
module: "cdisk_spec",
|
|
},
|
|
];
|
|
|
|
fn main() -> Result<()> {
|
|
let out_dir = PathBuf::from(env::var("OUT_DIR")?);
|
|
|
|
// Compile protos from the local src directory.
|
|
let mut proto_paths = Vec::new();
|
|
for proto in LOCAL_PROTOS {
|
|
proto_paths.push(
|
|
["src", &format!("{}.proto", proto.module)]
|
|
.iter()
|
|
.collect::<PathBuf>(),
|
|
);
|
|
}
|
|
proto_build_tools::build_protos(&out_dir, proto_paths.as_slice());
|
|
|
|
Ok(())
|
|
}
|