From 4f7a6ae8abe1eecc2c6d1ecd933289f634d470d0 Mon Sep 17 00:00:00 2001 From: kevaundray Date: Wed, 22 Nov 2023 16:43:29 +0000 Subject: [PATCH] chore: Add build profiles that optimize for size (#3534) --- Cargo.toml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index bc2c4e9f73e..7b1b54198d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -123,3 +123,16 @@ num-traits = "0.2" # This is required to be able to run `cargo test` in acvm_js due to the `locals exceeds maximum` error. # See https://ritik-mishra.medium.com/resolving-the-wasm-pack-error-locals-exceed-maximum-ec3a9d96685b opt-level = 1 + + +[profile.size] +inherits = "release" +lto = true +opt-level = "z" + +[profile.size-aggressive] +inherits = "release" +strip = true +lto = true +panic = "abort" +opt-level = "z"