Split out an optional "llvm" feature

Also move OptLevel out of roc_gen (which
should really be called gen_llvm) and into roc_mono,
so it's no longer coupled to LLVM.
This commit is contained in:
Richard Feldman 2021-06-06 00:17:42 -04:00
parent 0e5619c422
commit b05342c678
14 changed files with 143 additions and 76 deletions

View file

@ -1,11 +1,19 @@
use roc_cli::{
build, build_app, docs, repl, BuildConfig, CMD_BUILD, CMD_DOCS, CMD_EDIT, CMD_REPL, CMD_RUN,
build_app, docs, repl, BuildConfig, CMD_BUILD, CMD_DOCS, CMD_EDIT, CMD_REPL, CMD_RUN,
DIRECTORY_OR_FILES, ROC_FILE,
};
use std::io;
use std::path::{Path, PathBuf};
use target_lexicon::Triple;
#[cfg(feature = "llvm")]
use roc_cli::build;
#[cfg(not(feature = "llvm"))]
fn build(_target: &Triple, _matches: &clap::ArgMatches, _config: BuildConfig) -> io::Result<i32> {
panic!("Building without LLVM is not currently supported.");
}
fn main() -> io::Result<()> {
let matches = build_app().get_matches();