Closed
Description
hi,
it seems that it's not possible to link javascript files from a rust library at the moment. The usual practice is by setting the --js-library $path_to_js_file
emcc-linker argument. But setting linker arguments from a lib is not allowed in rust (#36176, rust-lang/cargo#1293).
I can think of two possible solutions for this:
- allowing link args when compiling to asm.js/wasm
- using the extern-linking syntax and converting the link to an
--js-library
emcc argument to pull in the js file:
#[link(name="my_js_file")]
extern {
fn add(a: size_t, b: size_t) -> size_t;
}