diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2023-04-06 09:23:16 +0100 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2023-04-06 23:05:52 +0100 |
| commit | b5f87e6175db229e3e84e054ce23a1194cc535e4 (patch) | |
| tree | a0f5494fdac0566b893cd0184c972a2e055ad339 /cmake/platforms/emscripten.cmake | |
| parent | 3b9cafa09f783ccadda14d11fc8b73dc496368c0 (diff) | |
| download | puzzles-b5f87e6175db229e3e84e054ce23a1194cc535e4.zip puzzles-b5f87e6175db229e3e84e054ce23a1194cc535e4.tar.gz puzzles-b5f87e6175db229e3e84e054ce23a1194cc535e4.tar.bz2 puzzles-b5f87e6175db229e3e84e054ce23a1194cc535e4.tar.xz | |
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.
Diffstat (limited to 'cmake/platforms/emscripten.cmake')
| -rw-r--r-- | cmake/platforms/emscripten.cmake | 1 |
1 files changed, 1 insertions, 0 deletions
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") |