1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
use crate::VERSION;
use clap::Parser;
use std::env;
use std::path::PathBuf;
#[derive(Debug, Parser, Clone, Default)]
pub struct WasmFeatures {
#[clap(long = "enable-simd")]
pub simd: bool,
#[clap(long = "enable-threads")]
pub threads: bool,
#[clap(long = "enable-reference-types")]
pub reference_types: bool,
#[clap(long = "enable-multi-value")]
pub multi_value: bool,
#[clap(long = "enable-bulk-memory")]
pub bulk_memory: bool,
#[clap(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
}
}
}