summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Justin Kerk <dopefishjustin@gmail.com>2016-10-29 06:00:45 +0000
committer Justin Kerk <dopefishjustin@gmail.com>2016-10-29 06:00:45 +0000
commitb99be73f2db5d3f81edc96a92ac4839e7f1cc3ab (patch)
tree1da4d36e785de35e44005147befa8995f184b644
parent592c51d19e7a5e2037fff7037d7a1fbe0b308e6c (diff)
Experimental support for compiling to WebAssembly using Emscripten (not yet working) (nw)
-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