-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
27 lines (21 loc) · 893 Bytes
/
Copy pathbuild.rs
File metadata and controls
27 lines (21 loc) · 893 Bytes
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-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
//! Compile the vendored Substrate protos into a tonic client.
use std::env;
fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("cargo:rerun-if-changed=proto");
// Match openshell-core's pattern: use the bundled protoc from
// protobuf-src so the build does not depend on a system protoc that
// may lack the well-known type includes.
//
// SAFETY: build scripts are single-threaded.
#[allow(unsafe_code)]
unsafe {
env::set_var("PROTOC", protobuf_src::protoc());
}
tonic_prost_build::configure()
.build_server(false) // client-only -- the driver speaks to ate-api-server
.build_client(true)
.compile_protos(&["proto/ateapi.proto"], &["proto"])?;
Ok(())
}