From af8aff8e097ce55a7eac6fe5da1e71c45b4459ef 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 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index da2e2c6..5dc1ce3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,3 +32,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