aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2022-11-10 00:40:52 +0000
committerBen Harris <bjh21@bjh21.me.uk>2022-11-10 00:40:52 +0000
commit00e4d79db112140c47e32af6b1b09454f4e04f05 (patch)
treec1afbb67a53fc680d98aa98e1e31a385642f3f41
parent21157990942953465abc4325e4bfd6fdd1bb8cdd (diff)
downloadpuzzles-00e4d79db112140c47e32af6b1b09454f4e04f05.zip
puzzles-00e4d79db112140c47e32af6b1b09454f4e04f05.tar.gz
puzzles-00e4d79db112140c47e32af6b1b09454f4e04f05.tar.bz2
puzzles-00e4d79db112140c47e32af6b1b09454f4e04f05.tar.xz
js: Enable STRICT_JS in Emscripten
This turns on "use strict" in JavaScript, which enforces declaring variables among other things, and may allow better optimisations.
-rw-r--r--cmake/platforms/emscripten.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmake/platforms/emscripten.cmake b/cmake/platforms/emscripten.cmake
index 5c13f90..244cfcb 100644
--- a/cmake/platforms/emscripten.cmake
+++ b/cmake/platforms/emscripten.cmake
@@ -37,7 +37,8 @@ string(JOIN "," emcc_export_string ${emcc_export_list})
set(CMAKE_C_LINK_FLAGS "\
-s ALLOW_MEMORY_GROWTH=1 \
-s EXPORTED_FUNCTIONS='[${emcc_export_string}]' \
--s EXTRA_EXPORTED_RUNTIME_METHODS='[cwrap,callMain]'")
+-s EXTRA_EXPORTED_RUNTIME_METHODS='[cwrap,callMain]' \
+-s STRICT_JS=1")
if(WASM)
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -s WASM=1")
else()