marketdata-shootout/build.rs
Bradlee Speice 369613843d Add run analysis code, and clean up most warnings
Cap'n Proto has a bug in deserialization; both in packed and unpacked, it gets to 43116 of 62253 messages.
2019-09-06 22:23:46 -04:00

35 lines
1.0 KiB
Rust

extern crate capnpc;
use std::path::Path;
use std::process::Command;
fn main() {
capnpc::CompilerCommand::new()
.src_prefix("")
.file("marketdata.capnp")
.output_path("src/")
.run()
.expect("Unable to compile capnpc");
flatc_rust::run(flatc_rust::Args {
inputs: &[Path::new("marketdata.fbs")],
out_dir: Path::new("src/"),
..Default::default()
})
.expect("Unable to compile flatc");
// There's no Rust-style builder crate for SBE,
// so we need to run the command by hand.
// TODO: Automatically download the SBE JAR?
let _output = Command::new("java")
.arg("-Dsbe.output.dir=src")
.arg("-Dsbe.xinclude.aware=true")
.arg("-Dsbe.target.language=uk.co.real_logic.sbe.generation.rust.Rust")
.arg("-Dsbe.target.namespace=marketdata_sbe")
.arg("-jar")
.arg("sbe-all-1.13.2-all.jar")
.arg("marketdata.xml")
.output()
.expect("Unable to execute SBE compiler");
}