Open tomaka opened 3 years ago
Sounds good to me :+1:
Emscripten is only used when compiling C++ part for the web (e.g. using emcc directly, not going through rustc), but wasm32-unknown-unknown
is used for the rest. I guess we could specify the wasm32-unknown-unknown
triple to make wasm32-wasi
work too but I haven't experimented much with wasi yet.
This crate currently seems to use
cfg(target_arch = "wasm32")
in order to mean "the web". However,wasm32-wasi
is meant to be an actual operating-system-like environment. The WASI SDK for example provides a clang toolchain that can compile C/C++ code. Trying to compiling this crate forwasm32-wasi
yields errors aboutJsValue
not being found.I would suggest using
target_os = "emscripten"
rather thantarget_arch = "wasm32"
for everything Emscripten-related, and treattarget_os = "wasi"
in a cross-platform manner.