glslang/HOWTO-build-wasm.md
Ryan Harrison c96e42dca8 Add WASM build target for Web version of glslang
This adds build rules to support generating a WASM binary to be used
on the web. The API exposed to web applications is definated in the
new glslang.js.cpp file.
2019-08-08 15:08:10 -04:00

15 lines
725 B
Markdown

Build as usual (see `README.md`), but:
* Need `emsdk` in your *PATH*
+ Instructions located
[here](https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install)
* Do not checkout SPIRV-Tools into External/
+ Does not work correctly with emscripten out of the box and we don't want
it in the build anyway.
+ *TBD* Add flag to disable SPIRV-Tool inclusion even if directory is
present.
* Wrap call to `cmake` using `emconfigure`:
+ e.g. `emconfigure cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GLSLANG_WEB=ON
-DENABLE_HLSL=OFF -DCMAKE_INSTALL_PREFIX="$(pwd)/install" ..`
+ To get a 'true' size, make sure to use `brotli` to compress the .js and .wasm files