Skip to content

Commit

Permalink
Adds cross configuration to install protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
scottopell committed Mar 14, 2024
1 parent 0ba497d commit 2de1892
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,28 @@ tokio = { version = "1.32" }
tracing = { version = "0.1" }
uuid = { version = "1.6", default-features = false, features = ["v4", "serde"] }

# Ref https://github.com/cross-rs/cross/blob/main/docs/custom_images.md#adding-dependencies-to-existing-images
[workspace.metadata.cross.target.aarch64-unknown-linux-gnu]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get --assume-yes install protobuf-compiler:$CROSS_DEB_ARCH"
]
[workspace.metadata.cross.target.aarch64-unknown-linux-musl]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get --assume-yes install protobuf-compiler:$CROSS_DEB_ARCH"
]
[workspace.metadata.cross.target.x86_64-unknown-linux-gnu]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get --assume-yes install protobuf-compiler:$CROSS_DEB_ARCH"
]
[workspace.metadata.cross.target.x86_64-unknown-linux-musl]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get --assume-yes install protobuf-compiler:$CROSS_DEB_ARCH"
]

[profile.release]
lto = true # Optimize our binary at link stage.
codegen-units = 1 # Increases compile time but improves optmization alternatives.
Expand Down

0 comments on commit 2de1892

Please sign in to comment.