feat: host-target config resolution and cargo-style run args

This commit is contained in:
2026-08-03 00:40:51 +08:00
parent 1a6a261cac
commit 5e8037da97
9 changed files with 279 additions and 43 deletions

View File

@@ -105,6 +105,7 @@ pub fn normalize_platform(platform: &str) -> Option<&str> {
pub fn normalize_target_os(target: &str) -> &str {
match target {
"" => "",
"linux" => "x86_64-unknown-linux-gnu",
"macos" => "x86_64-apple-darwin",
"windows" => "x86_64-pc-windows-msvc",
@@ -515,6 +516,7 @@ mod tests {
#[test]
fn normalize_target_short_names() {
assert_eq!(normalize_target_os(""), "");
assert_eq!(normalize_target_os("linux"), "x86_64-unknown-linux-gnu");
assert_eq!(normalize_target_os("macos"), "x86_64-apple-darwin");
assert_eq!(normalize_target_os("windows"), "x86_64-pc-windows-msvc");