Replies: 1 comment 9 replies
-
Just set |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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.12
MacOS
11.5.1
(x86_64)CMake
3.22
(nix)Ninja
1.10.2
(nix)Xcode version
13.2.1
make wasm-debug
An 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 themake
scripts assume that variable exists instead of takingem++
fromPATH
Fix: Set manually the
EMSCRIPTEN
environment variable or change howbgfx.make
is generated so that those lines:becomes
Environment variable manually set then
make wasm-debug
againAnother error:
Without knowing how to disable threading with
genie
, I decided to usebgfx.cmake
which exposes the optionThen , I Cloned the
bgfx.cmake
repo and moved in itmkdir build && cd build
cmake .. -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=ON
was required to build the examples, even if-DDBGFX_BUILD_EXAMPLES=ON
is setcmake --build . --config=Debug
Error 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