| 1 | // SPDX-License-Identifier: Apache-2.0 |
| 2 | // SPDX-FileCopyrightText: Copyright contributors to the vLLM project |
| 3 | |
| 4 | fn main() -> Result<(), Box<dyn std::error::Error>> { |
| 5 | let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap(); |
| 6 | let proto_dir = std::path::PathBuf::from(manifest_dir); |
| 7 | let protos = [ |
| 8 | proto_dir.join("control.proto"), |
| 9 | proto_dir.join("inference.proto"), |
| 10 | ]; |
| 11 | |
| 12 | for proto in &protos { |
| 13 | println!("cargo:rerun-if-changed={}", proto.display()); |
| 14 | } |
| 15 | |
| 16 | let file_descriptor_set = protox::compile(&protos, [&proto_dir])?; |
| 17 | |
| 18 | tonic_prost_build::configure() |
| 19 | .build_server(true) |
| 20 | .build_client(true) |
| 21 | .compile_fds(file_descriptor_set)?; |
| 22 | |
| 23 | Ok(()) |
| 24 | } |