From ef7d18806257d0c732cf12f887601e92d71b9ff0 Mon Sep 17 00:00:00 2001 From: saolof Date: Tue, 17 Jan 2023 07:07:20 +0100 Subject: [PATCH] Add profile to generate a small final binary (#68) adds `profile.small`, which optimizes for binary size instead of runtime performance --- Cargo.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 3f875f3..9c690d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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*