From a20799b59a9c946c0a6cf5f16c30a84ad8555554 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sun, 21 Oct 2018 12:44:58 -0400 Subject: [PATCH] Change build options for emscripten. --- Makefile | 3 ++- src/include/janet/janet.h | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 90ceb3db..561a2922 100644 --- a/Makefile +++ b/Makefile @@ -107,7 +107,8 @@ $(JANET_LIBRARY): $(JANET_CORE_OBJECTS) ###################### EMCC=emcc -EMCCFLAGS=-std=c99 -Wall -Wextra -Isrc/include -fpic -O2 -s EXTRA_EXPORTED_RUNTIME_METHODS='["cwrap"]' +EMCCFLAGS=-std=c99 -Wall -Wextra -Isrc/include -fpic -O2 -s EXTRA_EXPORTED_RUNTIME_METHODS='["cwrap"]' \ + -s ALLOW_MEMORY_GROWTH=1 -s WASM=1 JANET_EMTARGET=janet.js JANET_WEB_SOURCES=$(JANET_CORE_SOURCES) $(JANET_WEBCLIENT_SOURCES) JANET_EMOBJECTS=$(patsubst %.c,%.bc,$(JANET_WEB_SOURCES)) diff --git a/src/include/janet/janet.h b/src/include/janet/janet.h index 0860a20b..1167a112 100644 --- a/src/include/janet/janet.h +++ b/src/include/janet/janet.h @@ -96,6 +96,8 @@ extern "C" { /* Check emscripten */ #ifdef __EMSCRIPTEN__ #define JANET_NO_DYNAMIC_MODULES +#define JANET_NO_NANBOX +#define JANET_WALIGN 8 #endif /* Define how global janet state is declared */ @@ -180,11 +182,13 @@ extern "C" { #endif /* Alignment for pointers */ +#ifndef JANET_WALIGN #ifdef JANET_32 #define JANET_WALIGN 4 #else #define JANET_WALIGN 8 #endif +#endif /***** END SECTION CONFIG *****/