HL update

This commit is contained in:
Joshua Granick
2019-03-13 11:13:19 -07:00
parent 84694f104c
commit 8d72e71357
6 changed files with 60 additions and 32 deletions

View File

@@ -59,7 +59,7 @@ class LinuxPlatform extends PlatformTarget
else if (project.targetFlags.exists("hl"))
{
targetType = "hl";
is64 = false;
is64 = true;
}
else if (project.targetFlags.exists("nodejs"))
{
@@ -92,7 +92,13 @@ class LinuxPlatform extends PlatformTarget
for (ndll in project.ndlls)
{
if (isRaspberryPi)
// TODO: Support single binary for HashLink
if (targetType == "hl")
{
ProjectHelper.copyLibrary(project, ndll, "Linux" + (is64 ? "64" : ""), "", ".hdll", applicationDirectory, project
.debug, targetSuffix);
}
else if (isRaspberryPi)
{
ProjectHelper.copyLibrary(project, ndll, "RPi", "",
(ndll.haxelib != null && (ndll.haxelib.name == "hxcpp" || ndll.haxelib.name == "hxlibc")) ? ".dso" : ".ndll", applicationDirectory,
@@ -101,8 +107,8 @@ class LinuxPlatform extends PlatformTarget
else
{
ProjectHelper.copyLibrary(project, ndll, "Linux" + (is64 ? "64" : ""), "",
(ndll.haxelib != null && (ndll.haxelib.name == "hxcpp" || ndll.haxelib.name == "hxlibc")) ? ".dso" : ".ndll", applicationDirectory,
project.debug, targetSuffix);
(ndll.haxelib != null && (ndll.haxelib.name == "hxcpp" || ndll.haxelib.name == "hxlibc")) ? ".dll" : ".ndll",
applicationDirectory, project.debug, targetSuffix);
}
}
}
@@ -130,8 +136,11 @@ class LinuxPlatform extends PlatformTarget
if (noOutput) return;
System.copyFile(targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-Debug" : "") + ".hl",
Path.combine(applicationDirectory, project.app.file + ".hl"));
// System.copyFile(targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-Debug" : "") + ".hl",
// Path.combine(applicationDirectory, project.app.file + ".hl"));
System.recursiveCopyTemplate(project.templatePaths, "bin/hl/linux", applicationDirectory);
System.copyFile(targetDirectory + "/obj/ApplicationMain.hl", Path.combine(applicationDirectory, "hlboot.dat"));
System.renameFile(Path.combine(applicationDirectory, "hl"), executablePath);
}
else if (targetType == "nodejs")
{
@@ -293,6 +302,11 @@ class LinuxPlatform extends PlatformTarget
"-DHXCPP_RANLIB=arm-linux-gnueabihf-ranlib"
]);
}
else if (targetFlags.exists("hl") && System.hostArchitecture == X64)
{
// TODO: Support single binary
commands.push(["-Dlinux", "-DHXCPP_M64", "-Dhashlink"]);
}
else
{
if (!targetFlags.exists("32") && System.hostArchitecture == X64)
@@ -318,11 +332,7 @@ class LinuxPlatform extends PlatformTarget
arguments.push("-verbose");
}
if (targetType == "hl")
{
System.runCommand(applicationDirectory, "hl", [project.app.file + ".hl"].concat(arguments));
}
else if (targetType == "nodejs")
if (targetType == "nodejs")
{
NodeJSHelper.run(project, targetDirectory + "/bin/ApplicationMain.js", arguments);
}

View File

@@ -53,7 +53,7 @@ class MacPlatform extends PlatformTarget
else if (project.targetFlags.exists("hl"))
{
targetType = "hl";
is64 = false;
is64 = true;
}
else if (project.targetFlags.exists("java"))
{
@@ -92,9 +92,18 @@ class MacPlatform extends PlatformTarget
for (ndll in project.ndlls)
{
ProjectHelper.copyLibrary(project, ndll, "Mac" + (is64 ? "64" : ""), "",
(ndll.haxelib != null && (ndll.haxelib.name == "hxcpp" || ndll.haxelib.name == "hxlibc")) ? ".dylib" : ".ndll", executableDirectory,
project.debug, targetSuffix);
// TODO: Support single binary for HashLink
if (targetType == "hl")
{
ProjectHelper.copyLibrary(project, ndll, "Mac" + (is64 ? "64" : ""), "", ".hdll", applicationDirectory, project
.debug, targetSuffix);
}
else
{
ProjectHelper.copyLibrary(project, ndll, "Mac" + (is64 ? "64" : ""), "",
(ndll.haxelib != null && (ndll.haxelib.name == "hxcpp" || ndll.haxelib.name == "hxlibc")) ? ".dll" : ".ndll",
applicationDirectory, project.debug, targetSuffix);
}
}
}
@@ -113,8 +122,11 @@ class MacPlatform extends PlatformTarget
if (noOutput) return;
System.copyFile(targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-Debug" : "") + ".hl",
Path.combine(executableDirectory, project.app.file + ".hl"));
// System.copyFile(targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-Debug" : "") + ".hl",
// Path.combine(executableDirectory, project.app.file + ".hl"));
System.recursiveCopyTemplate(project.templatePaths, "bin/hl/mac", applicationDirectory);
System.copyFile(targetDirectory + "/obj/ApplicationMain.hl", Path.combine(applicationDirectory, "hlboot.dat"));
System.renameFile(Path.combine(applicationDirectory, "hl"), executablePath);
}
else if (targetType == "java")
{
@@ -254,14 +266,22 @@ class MacPlatform extends PlatformTarget
{
var commands = [];
if (!targetFlags.exists("32") && (command == "rebuild" || System.hostArchitecture == X64))
if (targetFlags.exists("hl") && System.hostArchitecture == X64)
{
commands.push(["-Dmac", "-DHXCPP_CLANG", "-DHXCPP_M64"]);
// TODO: Support single binary
commands.push(["-Dmac", "-DHXCPP_CLANG", "-DHXCPP_M64", "-Dhashlink"]);
}
if (!targetFlags.exists("64") && (targetFlags.exists("32") || System.hostArchitecture == X86))
else
{
commands.push(["-Dmac", "-DHXCPP_CLANG", "-DHXCPP_M32"]);
if (!targetFlags.exists("32") && (command == "rebuild" || System.hostArchitecture == X64))
{
commands.push(["-Dmac", "-DHXCPP_CLANG", "-DHXCPP_M64"]);
}
if (!targetFlags.exists("64") && (targetFlags.exists("32") || System.hostArchitecture == X86))
{
commands.push(["-Dmac", "-DHXCPP_CLANG", "-DHXCPP_M32"]);
}
}
CPPHelper.rebuild(project, commands);
@@ -276,11 +296,7 @@ class MacPlatform extends PlatformTarget
arguments.push("-verbose");
}
if (targetType == "hl")
{
System.runCommand(applicationDirectory, "hl", [project.app.file + ".hl"].concat(arguments));
}
else if (targetType == "nodejs")
if (targetType == "nodejs")
{
NodeJSHelper.run(project, executableDirectory + "/ApplicationMain.js", arguments);
}