We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6199c5c commit 3eed576Copy full SHA for 3eed576
Cargo.toml
@@ -4,6 +4,11 @@ version = "0.0.0"
4
rust-version = "1.80"
5
edition = "2021"
6
7
+[features]
8
+default = ["server-api", "client-api"]
9
+client-api = []
10
+server-api = []
11
+
12
[dependencies]
13
tonic = {version = "*"}
14
tonic-health = {version = "*"}
build.rs
@@ -1,7 +1,15 @@
1
fn main() {
2
- tonic_build::configure()
3
- .build_server(true)
- .build_client(true)
+ let mut config = tonic_build::configure();
+ #[cfg(feature = "server-api")]
+ {
+ config = config.build_server(true);
+ }
+ #[cfg(feature = "client-api")]
+ config = config.build_client(true);
+ config
.compile(
&[
15
"proto/backend_api.proto",
0 commit comments