Skip to content

Commit

Permalink
Add support for some new WASI targets:
Browse files Browse the repository at this point in the history
* `wasm32-wasip1`
* `wasm32-wasip2`
* `wasm32-wasip1-threads`
  • Loading branch information
alexcrichton committed Feb 21, 2024
1 parent 138d000 commit c96375b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/targets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,8 @@ pub enum OperatingSystem {
Uefi,
VxWorks,
Wasi,
WasiP1,
WasiP2,
Watchos,
Windows,
}
Expand Down Expand Up @@ -703,6 +705,8 @@ impl OperatingSystem {
Uefi => Cow::Borrowed("uefi"),
VxWorks => Cow::Borrowed("vxworks"),
Wasi => Cow::Borrowed("wasi"),
WasiP1 => Cow::Borrowed("wasip1"),
WasiP2 => Cow::Borrowed("wasip2"),
Watchos => Cow::Borrowed("watchos"),
Windows => Cow::Borrowed("windows"),
}
Expand Down Expand Up @@ -747,6 +751,7 @@ pub enum Environment {
Sim,
Softfloat,
Spe,
Threads,
}

impl Environment {
Expand Down Expand Up @@ -786,6 +791,7 @@ impl Environment {
Sim => Cow::Borrowed("sim"),
Softfloat => Cow::Borrowed("softfloat"),
Spe => Cow::Borrowed("spe"),
Threads => Cow::Borrowed("threads"),
}
}
}
Expand Down Expand Up @@ -1417,6 +1423,8 @@ impl FromStr for OperatingSystem {
"uefi" => Uefi,
"vxworks" => VxWorks,
"wasi" => Wasi,
"wasip1" => WasiP1,
"wasip2" => WasiP2,
"watchos" => Watchos,
"windows" => Windows,
"espidf" => Espidf,
Expand Down Expand Up @@ -1469,6 +1477,7 @@ impl FromStr for Environment {
"sim" => Sim,
"softfloat" => Softfloat,
"spe" => Spe,
"threads" => Threads,
_ => return Err(()),
})
}
Expand Down Expand Up @@ -1685,6 +1694,9 @@ mod tests {
"wasm32-unknown-emscripten",
"wasm32-unknown-unknown",
"wasm32-wasi",
"wasm32-wasip1-threads",
"wasm32-wasip1",
"wasm32-wasip2",
"wasm64-unknown-unknown",
"wasm64-wasi",
"x86_64-apple-darwin",
Expand Down
2 changes: 2 additions & 0 deletions src/triple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ impl fmt::Display for Triple {
|| self.environment == Environment::Kernel))
|| self.operating_system == OperatingSystem::Fuchsia
|| self.operating_system == OperatingSystem::Wasi
|| self.operating_system == OperatingSystem::WasiP1
|| self.operating_system == OperatingSystem::WasiP2
|| (self.operating_system == OperatingSystem::None_
&& (self.architecture == Architecture::Arm(ArmArchitecture::Armv4t)
|| self.architecture == Architecture::Arm(ArmArchitecture::Armv5te)
Expand Down

0 comments on commit c96375b

Please sign in to comment.