Replies: 2 comments 9 replies
-
|
Just set |
Beta Was this translation helpful? Give feedback.
9 replies
-
|
https://github.com/d3fault/bgfx-glfw-wasm-3dcube-template-starting-point |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
The documentation for building bgfx to webassembly using emscripten is missing.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear documentation for building to webassembly should be present. It should contain:
What I tried
Here's what I tried for now despite the lack of instructions, and what issues I've encountered.
First, building bgfx with genie:
I have emscripten installed on my computer following the instructions here: https://emscripten.org/docs/getting_started/downloads.html
Emscripten version
3.1.12MacOS
11.5.1(x86_64)CMake
3.22(nix)Ninja
1.10.2(nix)Xcode version
13.2.1make wasm-debugAn error encountered:
Reason: emsdk (the supported installation instruction from emscripten) don't set the environment variable
EMSCRIPTEN, and their official docker image don't set that variable either, and themakescripts assume that variable exists instead of takingem++fromPATHFix: Set manually the
EMSCRIPTENenvironment variable or change howbgfx.makeis generated so that those lines:becomes
Environment variable manually set then
make wasm-debugagainAnother error:
Without knowing how to disable threading with
genie, I decided to usebgfx.cmakewhich exposes the optionThen , I Cloned the
bgfx.cmakerepo and moved in itmkdir build && cd buildcmake .. -DCMAKE_TOOLCHAIN_FILE=/path/to/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -G"Ninja Multi-Config" -DBGFX_CONFIG_MULTITHREADED=OFF -DBGFX_INSTALL_EXAMPLES=ON-DBGFX_INSTALL_EXAMPLES=ONwas required to build the examples, even if-DDBGFX_BUILD_EXAMPLES=ONis setcmake --build . --config=DebugError with the following output
What are the instructions to build the example using web assembly? What are the requirements to start developing with bgfx using emscripten? It seems like the current documentation is lacking.
If someone knows how to build for the webassembly platform, instructions on how to build the examples would be highly appreciated 🙏 I am willing to help with documentation efforts if I can successfully build bgfx and examples with emscripten.
Beta Was this translation helpful? Give feedback.
All reactions