summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreska <eska@eska.me>2016-11-30 22:47:19 +0100
committereska <eska@eska.me>2016-11-30 23:47:38 +0100
commit290d79f26c0c6cd00a35ae64fb6eecacedbb3937 (patch)
tree287da1004eecc7599bcc987d07db8c0bf170cb1b
parentd5c6806e16c5d809c749b999ae91ae22dc25348e (diff)
Emit asm.js code into a dedicated file for asm.js export
This helps prevent browser lockups during start-up at the cost of having to distribute an extra file.
-rw-r--r--platform/javascript/detect.py1
-rw-r--r--platform/javascript/export/export.cpp5
2 files changed, 6 insertions, 0 deletions
diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py
index 35352becf8..2cb6874000 100644
--- a/platform/javascript/detect.py
+++ b/platform/javascript/detect.py
@@ -96,6 +96,7 @@ def configure(env):
else:
env.Append(CPPFLAGS=['-s', 'ASM_JS=1'])
env.Append(LINKFLAGS=['-s', 'ASM_JS=1'])
+ env.Append(LINKFLAGS=['--separate-asm'])
if env['javascript_eval'] == 'yes':
env.Append(CPPFLAGS=['-DJAVASCRIPT_EVAL_ENABLED'])
diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp
index 721aef3e50..ab64ffbb45 100644
--- a/platform/javascript/export/export.cpp
+++ b/platform/javascript/export/export.cpp
@@ -320,6 +320,11 @@ Error EditorExportPlatformJavaScript::export_project(const String& p_path, bool
file=p_path.get_file().basename()+".js";
}
+ if (file=="godot.asm.js") {
+
+ file=p_path.get_file().basename()+".asm.js";
+ }
+
if (file=="godot.mem") {
file=p_path.get_file().basename()+".mem";