forked from lancedb/lance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rs
27 lines (22 loc) · 777 Bytes
/
build.rs
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
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright The Lance Authors
use std::io::Result;
fn main() -> Result<()> {
println!("cargo:rerun-if-changed=protos");
#[cfg(feature = "protoc")]
// Use vendored protobuf compiler if requested.
std::env::set_var("PROTOC", protobuf_src::protoc());
let mut prost_build = prost_build::Config::new();
prost_build.extern_path(".lance.file", "::lance_file::format::pb");
prost_build.protoc_arg("--experimental_allow_proto3_optional");
prost_build.enable_type_names();
prost_build.compile_protos(
&[
"./protos/table.proto",
"./protos/transaction.proto",
"./protos/rowids.proto",
],
&["./protos"],
)?;
Ok(())
}