rust编译体积优化

Cargo优化

Cargo.toml

[profile.release]
#缩小编译后体积
strip = true
# strip = "debuginfo" #仅移除debug信息

lto = true #启用链接时间优化
panic = "abort" #panic时直接abort
opt-level = "z" #优化级别   1, 2, 3, "s", "z"

rust编译体积优化
https://lkhsss.github.io/Rust/rust编译体积优化/
作者
Lkhsss
发布于
2024年8月24日
许可协议