From e9dcdb015b0f7444a56b7b33516eb4fc55acd869 Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 18 Feb 2025 23:18:47 +0800 Subject: [PATCH] modify hosted mode specifier to clarify build intentions --- xtask/src/builder.rs | 15 ++++++++++++++- xtask/src/main.rs | 4 ++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/xtask/src/builder.rs b/xtask/src/builder.rs index 3676f9cfe..77d368d76 100644 --- a/xtask/src/builder.rs +++ b/xtask/src/builder.rs @@ -262,6 +262,17 @@ impl Builder { self } + /// Configure for hosted mode + pub fn target_hosted_baosec(&mut self) -> &mut Builder { + self.loader = CrateSpec::None; + self.target = None; + self.target_kernel = None; + self.stream = BuildStream::Release; + self.utra_target = "hosted-baosec".to_string(); + self.run_svd2repl = false; + self + } + /// Configure for renode targets pub fn target_renode(&mut self) -> &mut Builder { self.target = Some(crate::TARGET_TRIPLE_RISCV32.to_string()); @@ -668,7 +679,7 @@ impl Builder { self.features.push("renode".into()); self.loader_features.push("renode".into()); self.kernel_features.push("renode".into()); - } else if self.utra_target.contains("hosted") { + } else if self.utra_target == "hosted" { self.features.push("hosted".into()); // there is no loader in hosed mode self.kernel_features.push("hosted".into()); @@ -696,6 +707,8 @@ impl Builder { self.kernel_features.push(format!("utralib/{}", &self.utra_target)); self.loader_features.push("cramium-soc".into()); self.loader_features.push(format!("utralib/{}", &self.utra_target)); + } else if self.utra_target.contains("hosted-baosec") { + self.features.push("hosted-baosec".into()); } else { return Err("Target unknown: please check your UTRA target".into()); } diff --git a/xtask/src/main.rs b/xtask/src/main.rs index ffca337d4..bbcf15419 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -367,8 +367,8 @@ fn main() -> Result<(), Box> { Some("baosec-emu") => { let bao_pkgs = ["xous-ticktimer", "xous-log", "xous-names", "modals", "bao-video"]; builder - .target_hosted() - .add_feature("hosted-baosec") + // hosted-baosec feature added below + .target_hosted_baosec() .add_services(&bao_pkgs) .add_apps(&get_cratespecs()); }