use crate::VERSION;
use std::env;
use std::path::PathBuf;
use structopt::StructOpt;
#[derive(Debug, StructOpt, Clone)]
pub struct WasmFeatures {
#[structopt(long = "enable-simd")]
pub simd: bool,
#[structopt(long = "enable-threads")]
pub threads: bool,
#[structopt(long = "enable-reference-types")]
pub reference_types: bool,
#[structopt(long = "enable-multi-value")]
pub multi_value: bool,
#[structopt(long = "enable-bulk-memory")]
pub bulk_memory: bool,
#[structopt(long = "enable-all")]
pub all: bool,
}
pub fn get_cache_dir() -> PathBuf {
match env::var("WASMER_CACHE_DIR") {
Ok(dir) => {
let mut path = PathBuf::from(dir);
path.push(VERSION);
path
}
Err(_) => {
let mut temp_dir = env::temp_dir();
temp_dir.push("wasmer");
temp_dir.push(VERSION);
temp_dir
}
}
}