Add --disable-parallel-compilation CLI flag (#4911)

This commit is contained in:
Cheng Shao
2022-09-16 17:33:20 +02:00
committed by GitHub
parent cbd2efd236
commit f5580954af
2 changed files with 9 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ default = [
"wasmtime/cranelift", "wasmtime/cranelift",
"wasmtime/jitdump", "wasmtime/jitdump",
"wasmtime/vtune", "wasmtime/vtune",
"wasmtime/parallel-compilation",
] ]
pooling-allocator = [] pooling-allocator = []
memory-init-cow = [] memory-init-cow = []

View File

@@ -124,6 +124,10 @@ pub struct CommonOptions {
#[clap(long)] #[clap(long)]
pub disable_cache: bool, pub disable_cache: bool,
/// Disable parallel compilation
#[clap(long)]
pub disable_parallel_compilation: bool,
/// Enables or disables WebAssembly features /// Enables or disables WebAssembly features
#[clap(long, value_name = "FEATURE,FEATURE,...", parse(try_from_str = parse_wasm_features))] #[clap(long, value_name = "FEATURE,FEATURE,...", parse(try_from_str = parse_wasm_features))]
pub wasm_features: Option<WasmFeatures>, pub wasm_features: Option<WasmFeatures>,
@@ -292,6 +296,10 @@ impl CommonOptions {
} }
} }
if self.disable_parallel_compilation {
config.parallel_compilation(false);
}
if let Some(max) = self.static_memory_maximum_size { if let Some(max) = self.static_memory_maximum_size {
config.static_memory_maximum_size(max); config.static_memory_maximum_size(max);
} }