Skip to content

Commit 1350859

Browse files
committed
build: Use lto and strip the binary
- Makes the binary smaller - Prevents size regression when updating to new toolchain - Avoids bugs like: rust-lang/rust#62785 Signed-off-by: Joe Richey <[email protected]>
1 parent c092ce0 commit 1350859

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

.cargo/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[target.target]
2+
rustflags = ["-C", "link-arg=-s"]

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ edition = "2018"
77
# the profile used for `cargo build`
88
[profile.dev]
99
panic = "abort" # disable stack unwinding on panic
10+
lto = true
1011

1112
# the profile used for `cargo build --release`
1213
[profile.release]
1314
panic = "abort" # disable stack unwinding on panic
15+
lto = true
1416

1517
[dependencies]
1618
cpuio = "*"

0 commit comments

Comments
 (0)