hook up wasm and assembly dev backends

This commit is contained in:
Folkert 2021-09-15 20:53:00 +02:00
parent c221225ed9
commit 15fd312b6f
5 changed files with 104 additions and 13 deletions

View file

@ -229,10 +229,14 @@ pub fn build(matches: &ArgMatches, config: BuildConfig) -> io::Result<i32> {
let filename = matches.value_of(ROC_FILE).unwrap();
let original_cwd = std::env::current_dir()?;
let opt_level = if matches.is_present(FLAG_OPTIMIZE) {
OptLevel::Optimize
} else {
OptLevel::Normal
let opt_level = match (
matches.is_present(FLAG_OPTIMIZE),
matches.is_present(FLAG_DEV),
) {
(true, false) => OptLevel::Optimize,
(true, true) => panic!("development cannot be optimized!"),
(false, true) => OptLevel::Development,
(false, false) => OptLevel::Normal,
};
let emit_debug_info = matches.is_present(FLAG_DEBUG);
let emit_timings = matches.is_present(FLAG_TIME);