wasmer_compiler_cli/
common.rs1use crate::VERSION;
4use clap::Parser;
5use std::env;
6use std::path::PathBuf;
7
8#[derive(Debug, Parser, Clone, Default)]
9pub struct WasmFeatures {
12 #[clap(long = "enable-simd")]
14 pub simd: bool,
15
16 #[clap(long = "enable-threads")]
18 pub threads: bool,
19
20 #[clap(long = "enable-reference-types")]
22 pub reference_types: bool,
23
24 #[clap(long = "enable-multi-value")]
26 pub multi_value: bool,
27
28 #[clap(long = "enable-bulk-memory")]
30 pub bulk_memory: bool,
31
32 #[clap(long = "enable-all")]
34 pub all: bool,
35}
36
37pub fn get_cache_dir() -> PathBuf {
39 match env::var("WASMER_CACHE_DIR") {
40 Ok(dir) => {
41 let mut path = PathBuf::from(dir);
42 path.push(VERSION);
43 path
44 }
45 Err(_) => {
46 let mut temp_dir = env::temp_dir();
48 temp_dir.push("wasmer");
49 temp_dir.push(VERSION);
50 temp_dir
51 }
52 }
53}