Fix Emscripten asset support, fix Log.verbose on Emscripten builds
This commit is contained in:
@@ -50,6 +50,10 @@ class ThreadPool {
|
||||
__workCompleted = 0;
|
||||
#end
|
||||
|
||||
#if emscripten
|
||||
__synchronous = true;
|
||||
#end
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -111,6 +111,12 @@ class AssetHelper {
|
||||
|
||||
} else {
|
||||
|
||||
if (project.target == EMSCRIPTEN && (asset.embed != false || (asset.library != null && libraries.exists (asset.library) && libraries[asset.library].preload))) {
|
||||
|
||||
assetData.preload = true;
|
||||
|
||||
}
|
||||
|
||||
if (asset.embed == true || asset.type == FONT) {
|
||||
|
||||
assetData.className = "__ASSET__" + asset.flatName;
|
||||
|
||||
@@ -38,8 +38,16 @@ class EmscriptenPlatform extends PlatformTarget {
|
||||
public override function build ():Void {
|
||||
|
||||
var hxml = targetDirectory + "/haxe/" + buildType + ".hxml";
|
||||
var args = [ hxml, "-D", "emscripten", "-D", "webgl", "-D", "static_link"];
|
||||
|
||||
ProcessHelper.runCommand ("", "haxe", [ hxml, "-D", "emscripten", "-D", "webgl", "-D", "static_link" ] );
|
||||
if (LogHelper.verbose) {
|
||||
|
||||
args.push ("-D");
|
||||
args.push ("verbose");
|
||||
|
||||
}
|
||||
|
||||
ProcessHelper.runCommand ("", "haxe", args);
|
||||
|
||||
if (noOutput) return;
|
||||
|
||||
@@ -53,7 +61,7 @@ class EmscriptenPlatform extends PlatformTarget {
|
||||
|
||||
ProcessHelper.runCommand ("", "emcc", [ targetDirectory + "/obj/Main.cpp", "-o", targetDirectory + "/obj/Main.o" ], true, false, true);
|
||||
|
||||
var args = [ "Main.o" ];
|
||||
args = [ "Main.o" ];
|
||||
|
||||
for (ndll in project.ndlls) {
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ import sys.FileSystem;
|
||||
|
||||
if (rootPath == null) {
|
||||
|
||||
#if (ios || tvos)
|
||||
#if (ios || tvos || emscripten)
|
||||
rootPath = "assets/";
|
||||
#elseif (windows && !cs)
|
||||
rootPath = FileSystem.absolutePath (haxe.io.Path.directory (#if (haxe_ver >= 3.3) Sys.programPath () #else Sys.executablePath () #end)) + "/";
|
||||
|
||||
Reference in New Issue
Block a user