changeset 5:7826fe343733

Force Emscripten to emit the static memory init code inside the JS file. - Emscripten emits it into a separate .mem file for optimised builds, as of 1.12.1 - The file is loaded asyncronously, so occasionally the runtime hadn't initialised before trying to call functions (happened in Chrome, similar to what we've seen before) - This is the easiest fix, without changing the JS for this simple example.
author Lucas Thompson <lucas.thompson@qmul.ac.uk>
date Wed, 24 Aug 2016 14:18:08 +0100
parents 3a5a6535d50d
children 9bba59806014
files Makefile.example.emscripten
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.example.emscripten	Wed Aug 24 10:50:40 2016 +0100
+++ b/Makefile.example.emscripten	Wed Aug 24 14:18:08 2016 +0100
@@ -30,6 +30,7 @@
 		../json/json11/json11.cpp
 
 EMFLAGS		:= \
+		--memory-init-file 0 \
 		-s NO_FILESYSTEM=1 \
 		-s MODULARIZE=1 \
 		-s ERROR_ON_UNDEFINED_SYMBOLS=1 \