build(vnt-core): 使用 vendored protoc,不再依赖系统安装

This commit is contained in:
lbl
2026-08-22 01:27:28 +08:00
parent 7513465b61
commit 6029fd113d
3 changed files with 74 additions and 1 deletions
+1
View File
@@ -55,3 +55,4 @@ widestring = "1.2"
[build-dependencies]
prost-build = "0.14"
protoc-bin-vendored = "3"
+8 -1
View File
@@ -1,6 +1,13 @@
fn main() {
let protoc_path = protoc_bin_vendored::protoc_bin_path()
.expect("failed to find vendored protoc");
let mut config = prost_build::Config::new();
config.protoc_executable(protoc_path);
config.protoc_arg("--experimental_allow_proto3_optional");
config
.compile_protos(
&[
@@ -12,4 +19,4 @@ fn main() {
&["proto"],
)
.unwrap();
}
}