mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-01-13 01:07:34 +00:00
e0983c7625
This module defines the protocol shared between the crosvm plugin process and main crosvm process. TEST=cargo build --features plugin BUG=chromium:800626 CQ-DEPEND=CL:892048 Change-Id: I5dfbe845644b7489f1918cecfcc07f28a223aa42 Reviewed-on: https://chromium-review.googlesource.com/869355 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
27 lines
881 B
Rust
27 lines
881 B
Rust
// Copyright 2017 The Chromium OS Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
extern crate protoc_rust;
|
|
|
|
use std::env;
|
|
use std::fs;
|
|
use std::io::Write;
|
|
use std::path::PathBuf;
|
|
|
|
fn main() {
|
|
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
|
|
|
|
protoc_rust::run(protoc_rust::Args {
|
|
out_dir: out_dir.as_os_str().to_str().unwrap(),
|
|
input: &["protos/plugin.proto"],
|
|
includes: &["protos"],
|
|
})
|
|
.expect("protoc");
|
|
|
|
let mut mod_out = fs::File::create(out_dir.join("proto_include.rs")).unwrap();
|
|
writeln!(mod_out,
|
|
"#[path = \"{}\"] pub mod plugin_proto;\npub use plugin_proto::*;",
|
|
out_dir.join("plugin.rs").display())
|
|
.unwrap();
|
|
}
|