summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--makefile4
-rw-r--r--scripts/genie.lua5
-rw-r--r--scripts/src/main.lua5
3 files changed, 14 insertions, 0 deletions
diff --git a/makefile b/makefile
index fbdcf366928..c2fb93ae148 100644
--- a/makefile
+++ b/makefile
@@ -742,6 +742,10 @@ endif
ifdef DEBUG_ARGS
PARAMS += --DEBUG_ARGS='$(DEBUG_ARGS)'
endif
+
+ifdef WEBASSEMBLY
+PARAMS += --WEBASSEMBLY='$(WEBASSEMBLY)'
+endif
#-------------------------------------------------
# All scripts
#-------------------------------------------------
diff --git a/scripts/genie.lua b/scripts/genie.lua
index 004c0228428..92a59fcd65f 100644
--- a/scripts/genie.lua
+++ b/scripts/genie.lua
@@ -377,6 +377,11 @@ newoption {
description = "Arguments for running debug build.",
}
+newoption {
+ trigger = "WEBASSEMBLY",
+ description = "Produce WebAssembly output when building with Emscripten.",
+}
+
dofile ("extlib.lua")
if _OPTIONS["SHLIB"]=="1" then
diff --git a/scripts/src/main.lua b/scripts/src/main.lua
index eb7cac4c8d5..abd91200edd 100644
--- a/scripts/src/main.lua
+++ b/scripts/src/main.lua
@@ -137,6 +137,11 @@ end
.. " -s DEMANGLE_SUPPORT=1"
end
+ if _OPTIONS["WEBASSEMBLY"] then
+ emccopts = emccopts
+ .. " -s BINARYEN=1"
+ end
+
if _OPTIONS["ARCHOPTS"] then
emccopts = emccopts .. " " .. _OPTIONS["ARCHOPTS"]
end