Skip to content

There are plans to support wasm? #205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wangbang79408854 opened this issue Dec 2, 2021 · 11 comments
Closed

There are plans to support wasm? #205

wangbang79408854 opened this issue Dec 2, 2021 · 11 comments

Comments

@wangbang79408854
Copy link

No description provided.

@kornelski
Copy link
Member

kornelski commented Dec 2, 2021

I think it's already supported?

@wangbang79408854
Copy link
Author

It's already supported.
i
how to set PKG_CONFIG_SYSROOT_DIR?

It's already supported.
I don’t know how to change the settings. For Android, I will set the cc and sysroot to compile successfully. How to set this wasm packaging environment? I use wasm-pack build to package or the prompt is not found <stdio.h> I think it should be cc and sysroot settings The problem

@kornelski
Copy link
Member

kornelski commented Dec 3, 2021

You need to use emscripten target, which provides stdio.h and alike.

rustup target add wasm32-unknown-emscripten
# install emscripten and set up env for emcc, and then
cargo build --target wasm32-unknown-emscripten --lib

@wangbang79408854
Copy link
Author

rust-lang/rust#85821 this。reslove my error

@kornelski
Copy link
Member

Great.

@wangbang79408854
Copy link
Author

Do you have the glue js for the wasm project? I found that the wasm file packaged in the project is difficult to use

@kornelski
Copy link
Member

No, I don't. You'll have to use the public interface in Rust, and then export (perhaps with wasm-bindgen) your own entry point.

@wangbang79408854
Copy link
Author

wasm-bindge is use wasm32-unknown-unknown? but gifski is only use wasm32-unknown-emscripten

@kornelski
Copy link
Member

Ooof, indeed. You'll need to manually write the wrapper using #[no_mangle] extern fn. I haven't done it this way, so I can't recommend specifics.

@wangbang79408854
Copy link
Author

I have given up using wasm, on the server,How to start multithreading, currently only two CPUs are used

@jamsinclair
Copy link

If anyone stumbles upon this issue via a search engine or llm, I've hacked together a wasm port with an easy JavaScript interface that should be easy to get started with – https://github.com/jamsinclair/gifski-wasm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants