Skip to content

Commit

Permalink
Change Emscripten build options to nqc.js SINGLE_FILE
Browse files Browse the repository at this point in the history
  • Loading branch information
mesheets committed Jul 1, 2024
1 parent 24527bf commit 63e28d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,20 @@ ifneq (,$(strip $(findstring $(TARGETTYPE), WebAssembly)))
CXX = emcc
OBJ_SUBDIR_NAME = wobj
EXEC_SUBDIR_NAME = wasm
EXEC_EXT = .html
EXEC_EXT = .js

# Emscripten optimization flags documentation
# - https://emscripten.org/docs/optimizing/Optimizing-Code.html#optimizing-code
# - https://emscripten.org/docs/tools_reference/emcc.html#emcc-compiler-optimization-options
CFLAGS += -Os

# Documentation for various Emscripten flags
# - Full List: https://github.com/emscripten-core/emscripten/blob/main/src/settings.js
# - Modularize: https://emscripten.org/docs/getting_started/FAQ.html#can-i-use-multiple-emscripten-compiled-programs-on-one-web-page
# - Environment: https://emscripten.org/docs/getting_started/FAQ.html#can-i-build-javascript-that-only-runs-on-the-web
# - Single File: https://emscripten.org/docs/compiling/Building-Projects.html?highlight=SINGLE_FILE#emscripten-linker-output-files
CFLAGS_EXEC += --shell-file ./emscripten/webnqc_shell.html -s EXPORT_NAME=createWebNqc -s EXPORTED_RUNTIME_METHODS='["callMain","FS"]' \
-s INVOKE_RUN=false -s MODULARIZE=1 -s ENVIRONMENT=web -s WASM=0
-s INVOKE_RUN=false -s MODULARIZE=1 -s ENVIRONMENT=web -s SINGLE_FILE
else
ifneq (,$(strip $(findstring $(OSTYPE), Darwin)))
# Mac OS X
Expand Down

0 comments on commit 63e28d9

Please sign in to comment.