aboutsummaryrefslogtreecommitdiff
path: root/zkvms/zkm/sdk/build.rs
blob: 18132e8df66572e3a2696103ba06f7acd50036e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
fn main() -> Result<(), Box<dyn std::error::Error>> {
    if let Some(_snark_flag) = std::env::var_os("NO_USE_SNARK") {
        tonic_build::configure()
            .protoc_arg("--experimental_allow_proto3_optional")
            .compile(&["src/proto/stage.proto"], &["src/proto"])?;
    } else {
        println!("cargo:rustc-link-search=native=./sdk/src/local/libsnark");
        println!("cargo:rustc-link-lib=dylib=snark");
        tonic_build::configure()
            .protoc_arg("--experimental_allow_proto3_optional")
            .compile(&["src/proto/stage.proto"], &["src/proto"])?;
    }

    Ok(())
}