feat: update version to 0.6.7, enhance build configuration, and add dcr tree command

This commit is contained in:
2026-05-22 14:37:45 +08:00
parent 9ad968374e
commit ef2fb1e8e4
12 changed files with 83 additions and 7 deletions

View File

@@ -129,6 +129,19 @@ fn default_flags(profile: &str) -> &'static [&'static str] {
}
}
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
}
}
fn build_objects(
compiler: &str,
sources: &[String],
@@ -183,7 +196,8 @@ fn build_object(
cmd.arg(format!("-std={}", ctx.standard));
}
if ctx.cflags.is_empty() {
let use_dcr_defaults = ctx.cflags.is_empty() && !is_bare_metal_target(ctx.target);
if use_dcr_defaults {
for flag in default_flags(ctx.profile) {
cmd.arg(flag);
}