From 45059a910c31b80146c7b41f22f0ed08aef2ab21 Mon Sep 17 00:00:00 2001 From: Scott Mabin Date: Tue, 12 Mar 2024 16:18:14 +0000 Subject: [PATCH] Add a debug and release profile --- Cargo.toml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index da2e2c6..d517030 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,9 +5,6 @@ authors = ["{{ authors }}"] edition = "2021" license = "MIT OR Apache-2.0" -[profile.release] -debug = true - [dependencies] {{ mcu }}-hal = "{{ hal_version }}" esp-backtrace = { version = "0.11.0", features = ["{{ mcu }}", "panic-handler", "exception-handler", "println"] } @@ -32,3 +29,17 @@ heapless = { version = "0.8.0", default-features = false } [features] default = ["{{ mcu }}-hal/xtal-40mhz"] {% endif %} + +[profile.dev] +# Rust debug is too slow. +# For debug builds always builds with some optimization +opt-level = "s" + +[profile.release] +codegen-units = 1 # LLVM can perform better optimizations using a single thread +debug = 2 +debug-assertions = false +incremental = false +lto = 'fat' +opt-level = 's' +overflow-checks = false