https://github.com/bugthesystem/wasm-emc2
:rocket: C++ Webassembly experiments using Emscripten
https://github.com/bugthesystem/wasm-emc2
Last synced: 5 months ago
JSON representation
:rocket: C++ Webassembly experiments using Emscripten
- Host: GitHub
- URL: https://github.com/bugthesystem/wasm-emc2
- Owner: bugthesystem
- License: mit
- Created: 2017-11-10T16:51:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-09-22T12:21:15.000Z (over 1 year ago)
- Last Synced: 2025-04-06T13:56:38.492Z (about 1 year ago)
- Language: C++
- Homepage:
- Size: 810 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WASM EMCC
> C++ & Webassembly experiments using Emscripten on OSX
## Prerequisites
```sh
brew install cmake
```
## Emscripten SDK
```sh
git clone https://github.com/juj/emsdk.git
cd emsdk
./emsdk install --build=Release sdk-incoming-64bit binaryen-master-64bit
./emsdk activate --global --build=Release sdk-incoming-64bit binaryen-master-64bit
source ./emsdk_env.sh
```
## Compile
```sh
emcc -o out/index.html main.c -O3 -s WASM=1 \
--shell-file html_template/shell_minimal.html -s NO_EXIT_RUNTIME=1
emcc main.cpp -s USE_SDL=2 -s WASM=1 -s ASYNCIFY -o out/index.html
```
## Preview
```sh
# install simple http server
npm install -g lite-server
```
```sh
lite-server out/
```
|> z i λ a s a l