-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.O-asmjsTarget: asm.js - http://asmjs.org/Target: asm.js - http://asmjs.org/O-emscriptenTarget: 50% off wasm32-unknown-musl. the savings come out of stdio.h, but hey, you get SDL!Target: 50% off wasm32-unknown-musl. the savings come out of stdio.h, but hey, you get SDL!
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;
}
RReverser, dashed and vvanders
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.O-asmjsTarget: asm.js - http://asmjs.org/Target: asm.js - http://asmjs.org/O-emscriptenTarget: 50% off wasm32-unknown-musl. the savings come out of stdio.h, but hey, you get SDL!Target: 50% off wasm32-unknown-musl. the savings come out of stdio.h, but hey, you get SDL!