Skip to content

Commit

Permalink
Improve WebAssembly build
Browse files Browse the repository at this point in the history
Add compatibility with old and new versions of the Emscripten system libraries
  • Loading branch information
schellingb committed Sep 28, 2021
1 parent 00070aa commit 9c5adf4
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
6 changes: 1 addition & 5 deletions Linux/ZillaLibLinux.mk
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,7 @@ endif
.PHONY: all clean run gdb
all: $(APPOUTBIN) $(ASSET_ZIP)

define MAKEAPPOBJ

$(APPOUTDIR)/$(basename $(notdir $(1)))$(OBJEXT): $(1) ; $$(call COMPILE,$$@,$$<,$(2),$(GCCMFLAG) $(3) $$(APPFLAGS) -MMD -MP)

endef
MAKEAPPOBJ = $(APPOUTDIR)/$(basename $(notdir $(1)))$(OBJEXT): $(1) ; $$(call COMPILE,$$@,$$<,$(2),$(GCCMFLAG) $(3) $$(APPFLAGS) -MMD -MP)

APPOBJS := $(addprefix $(APPOUTDIR)/,$(notdir $(patsubst %.c,%$(OBJEXT),$(patsubst %.cpp,%$(OBJEXT),$(APPSOURCES)))))
$(shell $(CMD_DEL_OLD_OBJ) $(APPOBJS:%.o=%.d))
Expand Down
2 changes: 1 addition & 1 deletion WebAssembly/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ On Windows it's much simpler to use 7zip to just extract `clang.exe` and `wasm-l

## Getting System Libraries
The system libraries are maintained in the [Emscripten project](https://github.com/emscripten-core/emscripten/tree/master/system).
Just download the [GitHub archive](https://github.com/emscripten-core/emscripten/archive/master.zip) and extract only the `System` directory from it.
Just download the [GitHub archive](https://github.com/emscripten-core/emscripten/archive/refs/heads/main.zip) and extract only the `System` directory from it.

## Getting Python
If you already have Python (any version) on your system, you're good to go.
Expand Down
2 changes: 1 addition & 1 deletion WebAssembly/ZillaLibWasm.js
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,7 @@ env.asin = env.asinf = Math.asin;
env.sqrt = env.sqrtf = Math.sqrt;
env.atan = env.atanf = Math.atan;
env.atan2 = env.atan2f = Math.atan2;
env.fabs = env.fabsf = env.abs = Math.abs;
env.fabs = env.fabsf = env.abs = env.fabsl = Math.abs;
env.round = env.roundf = env.rint = env.rintf = Math.round;

ZLJS_WASM_IMPORTS(env);
Expand Down
Loading

0 comments on commit 9c5adf4

Please sign in to comment.