2018-05-14 08:29:04 -07:00
|
|
|
#[cfg(feature = "serialization-protobuf")]
|
|
|
|
mod feature_protobuf {
|
2018-05-17 07:50:47 -07:00
|
|
|
extern crate protobuf_codegen_pure;
|
2018-04-18 13:23:39 -07:00
|
|
|
|
2018-05-14 08:29:04 -07:00
|
|
|
pub fn main() {
|
2018-04-18 13:23:39 -07:00
|
|
|
println!("cargo:rerun-if-changed=proto/message.proto");
|
2018-05-17 07:50:47 -07:00
|
|
|
protobuf_codegen_pure::run(protobuf_codegen_pure::Args {
|
2018-04-18 13:23:39 -07:00
|
|
|
out_dir: "src/proto",
|
|
|
|
input: &["proto/message.proto"],
|
|
|
|
includes: &["proto"],
|
2018-05-12 07:32:07 -07:00
|
|
|
customize: Default::default(),
|
2018-04-18 13:23:39 -07:00
|
|
|
}).expect("protoc");
|
|
|
|
}
|
2018-03-14 17:03:21 -07:00
|
|
|
}
|
2018-05-14 08:29:04 -07:00
|
|
|
|
|
|
|
#[cfg(feature = "serialization-protobuf")]
|
|
|
|
fn main() {
|
|
|
|
feature_protobuf::main()
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(feature = "serialization-protobuf"))]
|
|
|
|
fn main() {}
|