Emscripten fix
This commit is contained in:
@@ -4,6 +4,7 @@ package lime.tools.platforms;
|
||||
//import openfl.utils.ByteArray;
|
||||
//import openfl.utils.CompressionAlgorithm;
|
||||
import haxe.io.Path;
|
||||
import haxe.Json;
|
||||
import haxe.Template;
|
||||
import lime.tools.helpers.AssetHelper;
|
||||
import lime.tools.helpers.CPPHelper;
|
||||
@@ -14,6 +15,7 @@ import lime.tools.helpers.LogHelper;
|
||||
import lime.tools.helpers.PathHelper;
|
||||
import lime.tools.helpers.ProcessHelper;
|
||||
import lime.project.AssetType;
|
||||
import lime.project.Haxelib;
|
||||
import lime.project.HXProject;
|
||||
import lime.project.PlatformTarget;
|
||||
import sys.io.File;
|
||||
@@ -72,7 +74,16 @@ class EmscriptenPlatform extends PlatformTarget {
|
||||
|
||||
}
|
||||
|
||||
args = args.concat ([ "ApplicationMain" + (project.debug ? "-debug" : "") + ".a", "-o", "ApplicationMain.o" ]);
|
||||
var json = Json.parse (File.getContent (PathHelper.getHaxelib (new Haxelib ("hxcpp"), true) + "/haxelib.json"));
|
||||
var prefix = "";
|
||||
|
||||
if (Std.parseFloat (json.version) > 3.1) {
|
||||
|
||||
prefix = "lib";
|
||||
|
||||
}
|
||||
|
||||
args = args.concat ([ prefix + "ApplicationMain" + (project.debug ? "-debug" : "") + ".a", "-o", "ApplicationMain.o" ]);
|
||||
ProcessHelper.runCommand (targetDirectory + "/obj", "emcc", args, true, false, true);
|
||||
|
||||
args = [ "ApplicationMain.o", "-s", "ASM_JS=1", "-s", "NO_EXIT_RUNTIME=1", "-s", "USE_SDL=2" ];
|
||||
|
||||
Reference in New Issue
Block a user