From b5f87e6175db229e3e84e054ce23a1194cc535e4 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Thu, 6 Apr 2023 09:23:16 +0100 Subject: 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. --- cmake/platforms/emscripten.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/platforms/emscripten.cmake b/cmake/platforms/emscripten.cmake index 2ddb445..ac7a739 100644 --- a/cmake/platforms/emscripten.cmake +++ b/cmake/platforms/emscripten.cmake @@ -41,6 +41,7 @@ list(TRANSFORM emcc_export_list APPEND \") 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") -- cgit v1.1