mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-30 01:17:57 +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,39 @@
|
||||
//! The LLVM projects to enable during the build.
|
||||
|
||||
/// The list of LLVM projects used as constants.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub enum LLVMProject {
|
||||
/// The Clang compiler.
|
||||
CLANG,
|
||||
/// LLD, the LLVM linker.
|
||||
LLD,
|
||||
/// The LLVM debugger.
|
||||
LLDB,
|
||||
/// The MLIR compiler.
|
||||
MLIR,
|
||||
}
|
||||
|
||||
impl std::str::FromStr for LLVMProject {
|
||||
type Err = String;
|
||||
|
||||
fn from_str(value: &str) -> Result<Self, Self::Err> {
|
||||
match value.to_lowercase().as_str() {
|
||||
"clang" => Ok(Self::CLANG),
|
||||
"lld" => Ok(Self::LLD),
|
||||
"lldb" => Ok(Self::LLDB),
|
||||
"mlir" => Ok(Self::MLIR),
|
||||
value => Err(format!("Unsupported LLVM project to enable: `{}`", value)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for LLVMProject {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::CLANG => write!(f, "clang"),
|
||||
Self::LLD => write!(f, "lld"),
|
||||
Self::LLDB => write!(f, "lldb"),
|
||||
Self::MLIR => write!(f, "mlir"),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user