Update Cargo.toml for optimized release binary

Configured the `Cargo.toml` to automatically strip symbols, optimize for size, enable Link Time Optimization (LTO), and set codegen-units to 1 for the release profile. This significantly reduces the size and improves the performance of the resulting binary.
This commit is contained in:
Ian Wijma 2023-11-21 00:08:17 +11:00
parent 9392325115
commit b7583f4db0
1 changed files with 7 additions and 0 deletions

View File

@ -7,3 +7,10 @@ edition = "2021"
[dependencies] [dependencies]
clap = { version = "4.4.8", features = ["derive", "unicode", "wrap_help"] } clap = { version = "4.4.8", features = ["derive", "unicode", "wrap_help"] }
[profile.release]
strip = true # Automatically strip symbols from the binary.
opt-level = "z" # Optimize for size.
lto = true
codegen-units = 1