-
Notifications
You must be signed in to change notification settings - Fork 144
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
Build fails for wasm on windows 10 #193
Comments
I've not tried myself so far, but I believe you're meant to use cross as the compiler and use their command, which would be something like |
Thanks for the suggestion. I gave these a go with no luck - I ran into a similar error telling me to set the environment variables, perhaps I did it wrong?
|
I looked into the error logs, seemed like something related to CMake, but can't be sure. But I did find a resource for building for web. Took some thorough reading but the README links to the raysan5 raylib wiki for build instructions, should be up-to-date assuming the build process for these bindings is still the same. |
It will be related but not the same, I believe I'd have to fork the bindings and play with the build scripts. It's way out of my depth to wrestle with cmake and cargo build scripts so I'm praying this will be a quick fix on the deltaphc's part when they find the time soon |
@largenumberhere You manage to compile to WASM? I'm using these flags, which compile, but produce an error in the browser. My raylib code fetches images from a local dir during local runs, maybe images must be served through HTTP. |
Thanks this gave me some inspiration.
I have thrown together some scripts to automate most of this process. They will require modifying build_wasm.sh
run_wasm.sh
*I had to modify the build arguments substaintially because the default stack size is easily blown out with raylib programs, This also bundles a folder **It is important to use the latest version of emsdk, because not all flags are supported by outdated builds on package repositories. ***The more proper process here involves node, wasm-pack or something I haven't ironed out all the faults yet, for one the website seems to hang at some parts of the main loop. I also wouldn't call this a correct solution because it relies on wsl but it'll be good enough for me. |
For future reference, building for WASM on 5.5 will not require the huge block of environment variables as we will use cmake to compile. |
I look forward to it |
Hi,
I am trying to build my project for wasm. I couldn't find any resources that covered this topic. I tried these commands out and had no luck.
cargo build --target=wasm32-unknown-unknown
(This command is similar to the one given in a compile error from
raylib-sys
, I had to modify it for powershell.)env EMCC_CFLAGS="-03 -sUSE_GLFW=3 -sGL_ENABLE_GET_PROC_ADDRESS -sWASM=1 -sALLOW_MEMORY_GROWTH=1 -sWASM_MEM_MAX=512MB -sTOTAL_MEM ORY=512MB -sABORTING_MALLOC=0 -sASYNCIFY -sFORCE_FILESYSTEM=1 -sASSERTIONS=1 -sERROR_ON_UNDEFINED_SYMBOLS=0 -sEXPORTED_RUNTIME_METHODS=ccallcwrap" cargo build --target=wasm32-unknown-unknown
I have attached the full backtrace.
wasm_raylibrs_error_log.txt
For completeness, I am working with raylib_rs5.0.1, cmake version 3.28.1, rust cargo 1.78.0 (54d8815d0 2024-03-26).
I hope this information is useful to you.
The text was updated successfully, but these errors were encountered: