"examples/pytorch/model_zoo/geometric/coarsening.py" did not exist on "7f65199a867fef67d0d747344beaa809fabea7f3"
build.rs 1.06 KB
Newer Older
Olivier Dehaene's avatar
Init  
Olivier Dehaene committed
1
2
3
use std::fs;

fn main() -> Result<(), Box<dyn std::error::Error>> {
OlivierDehaene's avatar
OlivierDehaene committed
4
    println!("cargo:rerun-if-changed=../../proto/**");
5

OlivierDehaene's avatar
OlivierDehaene committed
6
    fs::create_dir_all("src/v2/pb").unwrap_or(());
7
8
9
    let mut config = prost_build::Config::new();
    config.protoc_arg("--experimental_allow_proto3_optional");

Olivier Dehaene's avatar
Init  
Olivier Dehaene committed
10
11
12
    tonic_build::configure()
        .build_client(true)
        .build_server(false)
OlivierDehaene's avatar
OlivierDehaene committed
13
        .out_dir("src/v2/pb")
Olivier Dehaene's avatar
Init  
Olivier Dehaene committed
14
        .include_file("mod.rs")
15
16
        .compile_with_config(config, &["../../proto/generate.proto"], &["../../proto"])
        .unwrap_or_else(|e| panic!("protobuf compilation failed: {e}"));
Olivier Dehaene's avatar
Init  
Olivier Dehaene committed
17

OlivierDehaene's avatar
OlivierDehaene committed
18
19
20
21
22
23
24
25
26
27
28
29
    fs::create_dir_all("src/v3/pb").unwrap_or(());
    let mut config = prost_build::Config::new();
    config.protoc_arg("--experimental_allow_proto3_optional");

    tonic_build::configure()
        .build_client(true)
        .build_server(false)
        .out_dir("src/v3/pb")
        .include_file("mod.rs")
        .compile_with_config(config, &["../../proto/v3/generate.proto"], &["../../proto"])
        .unwrap_or_else(|e| panic!("protobuf compilation failed: {e}"));

Olivier Dehaene's avatar
Init  
Olivier Dehaene committed
30
31
    Ok(())
}