mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 02:09:06 +00:00
make prost build smaller
This commit is contained in:
+6
-4
@@ -128,16 +128,16 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
WindowsBuild::check_for_win();
|
WindowsBuild::check_for_win();
|
||||||
|
|
||||||
|
let proto_files_reflect = ["src/proto/peer_rpc.proto", "src/proto/common.proto"];
|
||||||
|
|
||||||
let proto_files = [
|
let proto_files = [
|
||||||
"src/proto/peer_rpc.proto",
|
|
||||||
"src/proto/common.proto",
|
|
||||||
"src/proto/error.proto",
|
"src/proto/error.proto",
|
||||||
"src/proto/tests.proto",
|
"src/proto/tests.proto",
|
||||||
"src/proto/cli.proto",
|
"src/proto/cli.proto",
|
||||||
"src/proto/web.proto",
|
"src/proto/web.proto",
|
||||||
];
|
];
|
||||||
|
|
||||||
for proto_file in &proto_files {
|
for proto_file in proto_files.iter().chain(proto_files_reflect.iter()) {
|
||||||
println!("cargo:rerun-if-changed={}", proto_file);
|
println!("cargo:rerun-if-changed={}", proto_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,9 +159,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
.service_generator(Box::new(rpc_build::ServiceGenerator::new()))
|
.service_generator(Box::new(rpc_build::ServiceGenerator::new()))
|
||||||
.btree_map(["."]);
|
.btree_map(["."]);
|
||||||
|
|
||||||
|
config.compile_protos(&proto_files, &["src/proto/"])?;
|
||||||
|
|
||||||
prost_reflect_build::Builder::new()
|
prost_reflect_build::Builder::new()
|
||||||
.file_descriptor_set_bytes("crate::proto::DESCRIPTOR_POOL_BYTES")
|
.file_descriptor_set_bytes("crate::proto::DESCRIPTOR_POOL_BYTES")
|
||||||
.compile_protos_with_config(config, &proto_files, &["src/proto/"])?;
|
.compile_protos_with_config(config, &proto_files_reflect, &["src/proto/"])?;
|
||||||
|
|
||||||
check_locale();
|
check_locale();
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user