Skip to content

Commit

Permalink
Add the modularization option
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-derevenetz committed Jan 6, 2025
1 parent 1f28bdc commit 7cc3fc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile.emscripten
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#
# FHEROES2_STRICT_COMPILATION: build in strict compilation mode (turns warnings into errors)
# FHEROES2_WITH_DEBUG: build in debug mode
# FHEROES2_WITH_MODULARIZE: wrap the emitted JS code in a function that returns a promise
# FHEROES2_DATA: set the built-in path to the fheroes2 data directory (e.g. /usr/share/fheroes2)

.PHONY: all clean translations
Expand Down
7 changes: 7 additions & 0 deletions src/dist/Makefile.emscripten
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,10 @@ ifdef FHEROES2_WITH_DEBUG
CCFLAGS := $(CCFLAGS) -gsource-map
LDFLAGS := $(LDFLAGS) -gsource-map
endif

ifdef FHEROES2_WITH_MODULARIZE
LDFLAGS := $(LDFLAGS) \
-sMODULARIZE \
-sEXPORTED_RUNTIME_METHODS=FS,ENV,noExitRuntime,addOnExit,run \
-sEXPORT_NAME=fheroes2
endif

0 comments on commit 7cc3fc1

Please sign in to comment.