Something similar to the non-wasm build, however it seems the link_name is different across msvc and emscripten...
extern "C" {
#[link_name = "_Z3addii"] // Note: I found this by poking around the clang-compiled `.o` file targetting wasm32.
pub fn add(a: ::std::os::raw::c_int, b: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
}
I've also tried some of the things in the discussion after #730 was closed:
The asmjs target results in a libclang panic
I am running the emsdk_env script beforehand, but am still not getting the function bindings.
It seems like
bindgen
doesn't produce bindings for functions when building withcargo-web
forwasm32-unknown-emscripten
.Input C/C++ Header
Bindgen Invocation
Actual Results
Output of
bindings.rs
:Output of
RUST_LOG=bindgen
: (note it's finding my system clang, but using the emsdk one?)Output of
clang --version
Expected Results
Something similar to the non-wasm build, however it seems the
link_name
is different across msvc and emscripten...I've also tried some of the things in the discussion after #730 was closed:
asmjs
target results in a libclang panicemsdk_env
script beforehand, but am still not getting the function bindings.Thanks for your time!