Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Add a debug and release profile #150

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand All @@ -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