-
-
Notifications
You must be signed in to change notification settings - Fork 7
Targeting WASM
The framework supports targeting WASM as a platform. This guide will help you set up everything to be able to easily deploy to WASM.
To compile to WASM, you will need to install Emscripten, which is a toolchain for building C/C++ applications that can run on the web.
You need to manually install Emscripten, using the following commands:
user $ git clone https://github.com/emscripten-core/emsdk.git
user $ cd emsdk
user $ git pull
user $ ./emsdk install latest
user $ ./emsdk activate latest
user $ source ./emsdk_env.sh
On Windows, you need to have Python 3 installed. After that, run the following commands:
> git clone https://github.com/emscripten-core/emsdk.git
> cd emsdk
> git pull
> emsdk.bat install latest
> emsdk.bat activate latest
> emsdk_env.bat
On macOS, you can install Emscripten through homebrew:
user $ brew install emscripten
Once you have everything installed, run emcc --version to check if everything is set up correctly. If everything is fine, you can try compiling a project.
To compile a project, do the following:
- Create a new folder for building under the root project directory, for example:
wasm-build - Enter the folder
- Run
emcmake cmake .. - Compile using the provided generated build system. For example, with
emmake:emmake make -j <number of compile jobs> - Serve the compiled files:
emrun <project name>.html - Open the served URL in your browser
If built successfully, you should be presented with a page, similar to this:
This project is supported by all the people who joined our discord server and became beta testers. If you want to join the discord you can click here.
- Home
- Beginner content
- Install guide
- Creating and using the UI components
- The Instance
- The Init Info struct
- Building better titlebar menus
- Textures
- Logging
- Unicode support
- Additional features
- Client-side bar
- Custom type definitions
- Memory management
- C API development
- Config files and Folders
- Interfaces
- Internal Event safety
- Customising the build system
- Modules system
- Collaborating with others
- Advanced content
- Loading dynamic libraries at runtime
- Understanding the library layout
- Compilation mode modifiers
- Supporting plugins
- Production export and deployment
- OS integration tips
- Targeting WASM
- Using a custom rendering engine:
- Using a custom windowing backend:
- Developer and contributor resources
- Misc