compiler_llvm_builder/platforms/
mod.rs1pub mod aarch64_linux_gnu;
6pub mod aarch64_linux_musl;
7pub mod aarch64_macos;
8pub mod shared;
9pub mod x86_64_linux_gnu;
10pub mod x86_64_linux_musl;
11pub mod x86_64_macos;
12pub mod x86_64_windows_gnu;
13
14use std::str::FromStr;
15
16#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
20pub enum Platform {
21 X86,
23 AArch64,
25 EraVM,
27 EVM,
29}
30
31impl FromStr for Platform {
32 type Err = String;
33
34 fn from_str(value: &str) -> Result<Self, Self::Err> {
35 match value {
36 "EraVM" => Ok(Self::EraVM),
37 "EVM" => Ok(Self::EVM),
38 value => Err(format!("Unsupported platform: `{}`", value)),
39 }
40 }
41}
42
43impl std::fmt::Display for Platform {
44 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
45 match self {
46 Self::X86 => write!(f, "X86"),
47 Self::AArch64 => write!(f, "AArch64"),
48 Self::EraVM => write!(f, "EraVM"),
49 Self::EVM => write!(f, "EVM"),
50 }
51 }
52}