Add profile to generate a small final binary (#68)

adds `profile.small`, which optimizes for binary size instead of runtime performance
This commit is contained in:
saolof 2023-01-17 07:07:20 +01:00 committed by GitHub
parent 0de3d2709f
commit ef7d188062
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,3 +10,11 @@ debug = true
panic = "abort"
lto = true
codegen-units = 1
[profile.small]
inherits = 'release'
opt-level = 'z' # Optimize for size
lto = true # Enable link-time optimization
codegen-units = 1 # Reduce number of codegen units to increase optimizations
panic = 'abort' # Abort on panic
strip = true # Strip symbols from binary*