0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2025-05-25 08:40:33 +00:00
Files
libsql/libsql-replication/build.rs
2023-10-30 17:26:18 +01:00

29 lines
908 B
Rust

use prost_build::Config;
fn main() -> Result<(), Box<dyn std::error::Error>> {
std::env::set_var("PROTOC", protobuf_src::protoc());
let mut config = Config::new();
config.bytes([".wal_log"]);
tonic_build::configure()
.protoc_arg("--experimental_allow_proto3_optional")
.type_attribute(".proxy", "#[cfg_attr(test, derive(arbitrary::Arbitrary))]")
.field_attribute(
".proxy.Value.data",
"#[cfg_attr(test, arbitrary(with = crate::test::arbitrary_rpc_value))]",
)
.field_attribute(
".proxy.ProgramReq.namespace",
"#[cfg_attr(test, arbitrary(with = crate::test::arbitrary_bytes))]",
)
.compile_with_config(
config,
&["proto/replication_log.proto", "proto/proxy.proto"],
&["proto"],
)?;
println!("cargo:rerun-if-changed=proto");
Ok(())
}