modify hosted mode specifier to clarify build intentions

This commit is contained in:
bunnie 2025-02-18 23:18:47 +08:00
parent 49f14d32c9
commit e9dcdb015b
2 changed files with 16 additions and 3 deletions

View file

@ -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());
}

View file

@ -367,8 +367,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
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());
}