mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-12 23:21:01 +00:00
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.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
//! 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"),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user