-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
27 lines (21 loc) · 681 Bytes
/
build.rs
File metadata and controls
27 lines (21 loc) · 681 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//! Build script for protobuf code generation.
use std::io::Result;
fn main() -> Result<()> {
// Tell cargo to rerun if proto files change
println!("cargo:rerun-if-changed=proto/");
// Configure prost to generate code
let mut config = prost_build::Config::new();
// Generate BTreeMap for map fields for deterministic serialization
config.btree_map(["."]);
// Compile the protobuf files
config.compile_protos(
&[
"proto/messages.proto",
"proto/messages-common.proto",
"proto/messages-bitcoin.proto",
"proto/messages-management.proto",
],
&["proto/"],
)?;
Ok(())
}