Browse Source

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.
eska 8 years ago
parent
commit
290d79f26c
2 changed files with 6 additions and 0 deletions
  1. 1 0
      platform/javascript/detect.py
  2. 5 0
      platform/javascript/export/export.cpp

+ 1 - 0
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'])

+ 5 - 0
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";