shithub: puzzles

Download patch

ref: b5f87e6175db229e3e84e054ce23a1194cc535e4
parent: 3b9cafa09f783ccadda14d11fc8b73dc496368c0
author: Ben Harris <bjh21@bjh21.me.uk>
date: Thu Apr 6 05:23:16 EDT 2023

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.

--- a/cmake/platforms/emscripten.cmake
+++ b/cmake/platforms/emscripten.cmake
@@ -41,6 +41,7 @@
 string(JOIN "," emcc_export_string ${emcc_export_list})
 set(CMAKE_C_LINK_FLAGS "\
 -s ALLOW_MEMORY_GROWTH=1 \
+-s ENVIRONMENT=web \
 -s EXPORTED_FUNCTIONS='[${emcc_export_string}]' \
 -s EXPORTED_RUNTIME_METHODS='[cwrap]' \
 -s STRICT_JS=1")