Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/keillion/emsdk-cheatlist
https://github.com/keillion/emsdk-cheatlist
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/keillion/emsdk-cheatlist
- Owner: Keillion
- License: mit
- Created: 2021-07-23T10:05:40.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-11T06:55:46.000Z (about 1 year ago)
- Last Synced: 2024-10-30T23:12:12.739Z (about 2 months ago)
- Language: JavaScript
- Size: 76.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# emsdk-cheatlist
Use cmake + [emsdk](https://emscripten.org/index.html) to build multiple wasm in one time.
Prepare: emscripten 3.1.30
modify emcc.py: https://github.com/Keillion/emscripten/commit/fc55d8790a55fe3b8976a542e1bde47a5295d103
[Dynamic link](https://emscripten.org/docs/compiling/Dynamic-Linking.html) sideModule.
Use [webidl](https://emscripten.org/docs/porting/connecting_cpp_and_javascript/WebIDL-Binder.html).
Generate idl cpp and js for reference
```shell
$ /emsdk/upstream/emscripten/tools/webidl_binder mainModule.idl mainModuleGlue
```## How to Build
```shell
$ mkdir build
$ cd build
$ emcmake cmake ../
$ emmake make
```In order to see which system libs are actually needed. [refer](https://emscripten.org/docs/compiling/Dynamic-Linking.html#system-libraries)
```shell
$ emmake make VERBOSE=1
```## Note
`html` need to be host in an HTTP server. The mimetype of `.wasm` needs to set as `application/wasm`.
## Free memery
Not freeing `char *` return value in webidl will cause a memory leak.
====
## std.js
Most fileds in wasmImport or wasmExport are not needed, I save a slimmed std.js here for reference.