feat(build): add freestanding, lto, strip, panic-abort, and codegen-units support in dcr.toml

This commit is contained in:
2026-06-16 16:42:56 +08:00
parent 3d596d7280
commit 21932ac94a
18 changed files with 242 additions and 73 deletions

View File

@@ -187,6 +187,19 @@ pub fn get_list_with_profile(config: &Config, field: &str, profile: &str) -> Vec
out
}
pub fn is_bare_metal_target(target: Option<&str>) -> bool {
if let Some(t) = target {
let lower = t.to_lowercase();
lower.contains("none")
|| lower.contains("-elf")
|| lower.contains("eabi")
|| lower.contains("baremetal")
|| lower.contains("bare-metal")
} else {
false
}
}
pub fn get_bool_with_profile(config: &Config, field: &str, profile: &str, default: bool) -> bool {
let base = config
.get(&format!("build.{field}"))