Skip to content

Commit

Permalink
fix: force environment to node
Browse files Browse the repository at this point in the history
This wasm binding requires node because of the requirement to have node
rawfs. It is therefore not good to leave emscripten to guess the runtime
environment. Instead, it is now forced at build time to node.
  • Loading branch information
abdes committed Apr 20, 2020
1 parent ffb00cc commit a8ef096
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,16 @@ if [ "$TARGET" == "all" ] || [ "$TARGET" == "binding" ]; then

SRCS="magic-js.cpp"
# Compile the code
# We enable FS, using node rawfs and we force the environment to always
# be node, thus disabling the auto-detection at runtime
EMCC_OPTIONS="-O3 \
-fno-exceptions \
--bind \
-s ASSERTIONS=1 \
-s ALLOW_MEMORY_GROWTH=1 \
-s MALLOC=emmalloc \
-s MODULARIZE=1 \
-s ENVIRONMENT=node \
-s FILESYSTEM=1 \
-s NODERAWFS=1 \
-o ../magic-js.js \
Expand Down

0 comments on commit a8ef096

Please sign in to comment.