ExPixel / miniaudio-rs

Rust bindings for miniaudio C library.
https://crates.io/crates/miniaudio
MIT License
49 stars 20 forks source link

Fix wasm32-unknown-emscripten cross-compile #74

Open kofigumbs opened 2 years ago

kofigumbs commented 2 years ago

This PR adds workarounds for two issues that manifest when compiling for WASM with Emscripten:

  --- stderr
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:828:2: error: Unsupported architecture
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h:36:2: error: architecture not supported
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
...

error[E0425]: cannot find function ma_context_get_devices in crate sys --> miniaudio-sys/examples/simple-enumeration-raw.rs:25:23 | 25 | let result = sys::ma_context_get_devices( | ^^^^^^^^^^^^^^^^^^^^^^ not found in sys