4 ms·
To make compiling easy, cargo will compile C sources (and more using build.rs), but of course that makes your Rust code dependent on compiling C code, and if yo
by efnx 4y ago
To make compiling easy, cargo will compile C sources (and more using build.rs), but of course that makes your Rust code dependent on compiling C code, and if your C build step isn’t ready for cross compilation then your Rust compile step cannot be.
Did you try wasm-pack?
- hardwaregeek 4y agowasm-pack doesn't do any sort of help for compiling C code. It mostly just helps with interop and bundling. I know that cargo compiles C, but it really should not be that hard to compile C code to WASI and provide a libc that works with WASI. The emscripten backend worked well except for this one minor issue, but when I asked online, I got a response that made it seem like I was being ridiculous for using emscripten in 2022. Meanwhile the WASI backend is clearly not mature yet either.