codemp-proto/build.rs

35 lines
778 B
Rust
Raw Permalink Normal View History

fn main() -> Result<(), Box<dyn std::error::Error>> {
let server = {
#[cfg(feature = "server")] { true }
#[cfg(not(feature = "server"))] { false }
};
let client = {
#[cfg(feature = "client")] { true }
#[cfg(not(feature = "client"))] { false }
};
let transport = {
#[cfg(any(feature = "server", feature = "client"))] { true }
#[cfg(not(any(feature = "server", feature = "client")))] { false }
};
Ok
(tonic_build::configure()
.build_server(server)
.build_client(client)
.build_transport(transport)
.compile_protos(
&[
"proto/common.proto",
"proto/cursor.proto",
"proto/files.proto",
"proto/auth.proto",
"proto/session.proto",
"proto/workspace.proto",
"proto/buffer.proto",
],
&["proto"],
)?)
2024-03-09 19:07:23 +01:00
}