0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2025-07-15 22:25:17 +00:00
Files
libsql/libsql-server/build.rs

26 lines
1008 B
Rust
Raw Normal View History

2023-01-03 13:54:06 +01:00
use prost_build::Config;
2023-05-30 16:12:21 +02:00
use vergen::EmitBuilder;
2023-01-03 13:54:06 +01:00
2022-12-12 12:19:14 +01:00
fn main() -> Result<(), Box<dyn std::error::Error>> {
2023-05-30 16:12:21 +02:00
EmitBuilder::builder().git_sha(false).all_build().emit()?;
2023-01-23 16:05:24 +01:00
std::env::set_var("PROTOC", protobuf_src::protoc());
2023-01-03 13:54:06 +01:00
let mut config = Config::new();
config.bytes([".wal_log", ".proxy.ProgramReq.namespace"]);
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::connection::write_proxy::test::arbitrary_rpc_value))]")
.field_attribute(".proxy.ProgramReq.namespace", "#[cfg_attr(test, arbitrary(with = crate::connection::write_proxy::test::arbitrary_bytes))]")
2023-01-03 13:54:06 +01:00
.compile_with_config(
config,
2023-02-13 17:36:49 +01:00
&["proto/replication_log.proto", "proto/proxy.proto"],
2023-01-03 13:54:06 +01:00
&["proto"],
)?;
2022-12-12 12:19:14 +01:00
println!("cargo:rerun-if-changed=proto");
Ok(())
}