close #19 : add cmake option for single-file wasm build

If enabled, we build ggwave using "-s SINGLE_FILE=1" which causes
the WASM to be embedded inside the .js file.

Otherwise, 2 separate files are produced:
- libggwave.js
- libggwave.wasm
This commit is contained in:
Georgi Gerganov
2021-02-20 19:57:47 +02:00
parent 580090c721
commit d3732946c6
3 changed files with 17 additions and 9 deletions

View File

@@ -21,6 +21,8 @@ endif()
if (EMSCRIPTEN)
set(GGWAVE_SUPPORT_SDL2_DEFAULT ON)
set(BUILD_SHARED_LIBS_DEFAULT OFF)
option(GGWAVE_WASM_SINGLE_FILE "ggwave: embed WASM inside the generated ggwave.js" ON)
else()
set(GGWAVE_SUPPORT_SDL2_DEFAULT ON)
set(BUILD_SHARED_LIBS_DEFAULT ON)