ref: 00e4d79db112140c47e32af6b1b09454f4e04f05
parent: 21157990942953465abc4325e4bfd6fdd1bb8cdd
author: Ben Harris <bjh21@bjh21.me.uk>
date: Wed Nov 9 19:40:52 EST 2022
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.
--- a/cmake/platforms/emscripten.cmake
+++ b/cmake/platforms/emscripten.cmake
@@ -37,7 +37,8 @@
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()