Skip to content

Commit 3eed576

Browse files
committed
Update
1 parent 6199c5c commit 3eed576

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

Cargo.toml

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ version = "0.0.0"
44
rust-version = "1.80"
55
edition = "2021"
66

7+
[features]
8+
default = ["server-api", "client-api"]
9+
client-api = []
10+
server-api = []
11+
712
[dependencies]
813
tonic = {version = "*"}
914
tonic-health = {version = "*"}

build.rs

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
fn main() {
2-
tonic_build::configure()
3-
.build_server(true)
4-
.build_client(true)
2+
let mut config = tonic_build::configure();
3+
#[cfg(feature = "server-api")]
4+
{
5+
config = config.build_server(true);
6+
}
7+
8+
#[cfg(feature = "client-api")]
9+
{
10+
config = config.build_client(true);
11+
}
12+
config
513
.compile(
614
&[
715
"proto/backend_api.proto",

0 commit comments

Comments
 (0)