js: set -s ENVIRONMENT=web in Emscripten

Puzzles only runs in Web browsers, so there's no need to include
support for Node or (for now at least) running in a Web worker.  This
removes about 5 kiB of code from the boilerplate JavaScript.
This commit is contained in:
Ben Harris
2023-04-06 09:23:16 +01:00
parent 3b9cafa09f
commit b5f87e6175

View File

@ -41,6 +41,7 @@ list(TRANSFORM emcc_export_list APPEND \")
string(JOIN "," emcc_export_string ${emcc_export_list}) string(JOIN "," emcc_export_string ${emcc_export_list})
set(CMAKE_C_LINK_FLAGS "\ set(CMAKE_C_LINK_FLAGS "\
-s ALLOW_MEMORY_GROWTH=1 \ -s ALLOW_MEMORY_GROWTH=1 \
-s ENVIRONMENT=web \
-s EXPORTED_FUNCTIONS='[${emcc_export_string}]' \ -s EXPORTED_FUNCTIONS='[${emcc_export_string}]' \
-s EXPORTED_RUNTIME_METHODS='[cwrap]' \ -s EXPORTED_RUNTIME_METHODS='[cwrap]' \
-s STRICT_JS=1") -s STRICT_JS=1")