Make the wasmtime-wasi-c dependency conditional on Unix.
This commit is contained in:
@@ -31,7 +31,6 @@ wasmtime-jit = { path = "wasmtime-jit" }
|
|||||||
wasmtime-obj = { path = "wasmtime-obj" }
|
wasmtime-obj = { path = "wasmtime-obj" }
|
||||||
wasmtime-wast = { path = "wasmtime-wast" }
|
wasmtime-wast = { path = "wasmtime-wast" }
|
||||||
wasmtime-wasi = { path = "wasmtime-wasi" }
|
wasmtime-wasi = { path = "wasmtime-wasi" }
|
||||||
wasmtime-wasi-c = { path = "wasmtime-wasi-c" }
|
|
||||||
docopt = "1.0.1"
|
docopt = "1.0.1"
|
||||||
serde = "1.0.75"
|
serde = "1.0.75"
|
||||||
serde_derive = "1.0.75"
|
serde_derive = "1.0.75"
|
||||||
@@ -43,6 +42,9 @@ wabt = "0.7"
|
|||||||
libc = "0.2.50"
|
libc = "0.2.50"
|
||||||
errno = "0.2.4"
|
errno = "0.2.4"
|
||||||
|
|
||||||
|
[target.'cfg(unix)'.dependencies]
|
||||||
|
wasmtime-wasi-c = { path = "wasmtime-wasi-c" }
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|||||||
@@ -50,9 +50,11 @@ use std::process::exit;
|
|||||||
use wabt;
|
use wabt;
|
||||||
use wasmtime_jit::{ActionOutcome, Context};
|
use wasmtime_jit::{ActionOutcome, Context};
|
||||||
use wasmtime_wasi::instantiate_wasi;
|
use wasmtime_wasi::instantiate_wasi;
|
||||||
use wasmtime_wasi_c::instantiate_wasi_c;
|
|
||||||
use wasmtime_wast::instantiate_spectest;
|
use wasmtime_wast::instantiate_spectest;
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
|
use wasmtime_wasi_c::instantiate_wasi_c;
|
||||||
|
|
||||||
static LOG_FILENAME_PREFIX: &str = "wasmtime.dbg.";
|
static LOG_FILENAME_PREFIX: &str = "wasmtime.dbg.";
|
||||||
|
|
||||||
const USAGE: &str = "
|
const USAGE: &str = "
|
||||||
@@ -235,8 +237,15 @@ fn main() {
|
|||||||
let wasi = if args.flag_wasi_common {
|
let wasi = if args.flag_wasi_common {
|
||||||
instantiate_wasi("", global_exports, &preopen_dirs, &argv, &environ)
|
instantiate_wasi("", global_exports, &preopen_dirs, &argv, &environ)
|
||||||
} else {
|
} else {
|
||||||
|
#[cfg(unix)]
|
||||||
|
{
|
||||||
instantiate_wasi_c("", global_exports, &preopen_dirs, &argv, &environ)
|
instantiate_wasi_c("", global_exports, &preopen_dirs, &argv, &environ)
|
||||||
}
|
}
|
||||||
|
#[cfg(not(unix))]
|
||||||
|
{
|
||||||
|
unimplemented!("wasmtime-wasi-c requires a *nix")
|
||||||
|
}
|
||||||
|
}
|
||||||
.expect("instantiating wasi");
|
.expect("instantiating wasi");
|
||||||
|
|
||||||
context.name_instance("wasi_unstable".to_owned(), wasi);
|
context.name_instance("wasi_unstable".to_owned(), wasi);
|
||||||
|
|||||||
Reference in New Issue
Block a user