Files
revive/crates/llvm-builder/src/target_env.rs
T
Cyrill Leutwiler 7f81f37e0c revive llvm builder utility (#154)
Pre-eliminary support for LLVM releases and resolc binary releases by streamlining the build process for all supported hosts platforms.

- Introduce the revive-llvm-builder crate with the revive-llvm builder utilty.
- Do not rely on the LLVM dependency in $PATH to decouple the system LLVM installation from the LLVM host dependency.
- Fix the emscripten build by decoupling the host and native LLVM dependencies. Thus allowing a single LLVM emscripten release that can be used on any host platform.
- An example Dockerfile building an alpine container with a fully statically linked resolc ELF binary.
- Remove the Debian builder utilities and workflow.
2025-01-13 15:58:27 +01:00

37 lines
1013 B
Rust

//! The target environments to build LLVM.
/// The list of target environments used as constants.
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum TargetEnv {
/// The GNU target environment.
#[default]
GNU,
/// The MUSL target environment.
MUSL,
/// The wasm32 Emscripten environment.
Emscripten,
}
impl std::str::FromStr for TargetEnv {
type Err = String;
fn from_str(value: &str) -> Result<Self, Self::Err> {
match value {
"gnu" => Ok(Self::GNU),
"musl" => Ok(Self::MUSL),
"emscripten" => Ok(Self::Emscripten),
value => Err(format!("Unsupported target environment: `{}`", value)),
}
}
}
impl std::fmt::Display for TargetEnv {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::GNU => write!(f, "gnu"),
Self::MUSL => write!(f, "musl"),
Self::Emscripten => write!(f, "emscripten"),
}
}
}