xref: /aosp_15_r20/external/bazelbuild-rules_rust/examples/bzlmod/proto_with_toolchain/Cargo.toml (revision d4726bddaa87cc4778e7472feed243fa4b6c267f)
1[workspace]
2resolver = "2"
3
4members = [
5    "proto_bindings",
6    "grpc_server",
7    "grpc_client",
8]
9
10
11[workspace.package]
12edition = "2021"
13rust-version = "1.78.0"
14readme = "README.md"
15
16
17[workspace.dependencies]
18# Internal crates
19proto_bindings = { path = "proto_bindings" }
20# External crates
21prost = { version = "0.12.6" }
22prost-types = { version = "0.12.6", default-features = false }
23tonic = { version = "0.11.0", features = ["transport"] }
24tonic-build = "0.11.0"
25tokio = { version = "1.38", default-features = false, features = ["macros", "net", "rt-multi-thread", "signal"] }
26
27
28# Optimize all crates
29[profile.release]
30opt-level = 3
31strip = true  # Automatically strip debug symbols from the binary
32lto = true    # Enable Link Time Optimization (LTO)
33codegen-units = 1 # Reduce Parallel Code Generation Units to Increase Optimization
34
35
36# There's a Cargo feature named profile-overrides
37# that lets you override the optimization level of dependencies.
38# https://docs.rust-embedded.org/book/unsorted/speed-vs-size.html
39[profile.release.package."*"]
40opt-level = 3
41strip = 'debuginfo'  # Automatically strip debug infos from the binary to reduce size
42codegen-units = 1 # Reduce Parallel Code Generation Units to Increase Optimization
43