HL/C on Linux
This commit is contained in:
@@ -224,6 +224,23 @@ class LinuxPlatform extends PlatformTarget
|
|||||||
if (noOutput) return;
|
if (noOutput) return;
|
||||||
|
|
||||||
HashlinkHelper.copyHashlink(project, targetDirectory, applicationDirectory, executablePath, is64);
|
HashlinkHelper.copyHashlink(project, targetDirectory, applicationDirectory, executablePath, is64);
|
||||||
|
|
||||||
|
if (project.targetFlags.exists("hlc"))
|
||||||
|
{
|
||||||
|
var command = ["gcc", "-O3", "-o", executablePath, "-std=c11", "-Wl,-rpath,$ORIGIN", "-I", Path.combine(targetDirectory, "obj"), Path.combine(targetDirectory, "obj/ApplicationMain.c"), "-L", applicationDirectory];
|
||||||
|
for (file in System.readDirectory(applicationDirectory))
|
||||||
|
{
|
||||||
|
switch Path.extension(file)
|
||||||
|
{
|
||||||
|
case "so", "hdll":
|
||||||
|
// ensure the executable knows about every library
|
||||||
|
command.push("-l:" + Path.withoutDirectory(file));
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
command.push("-lm");
|
||||||
|
System.runCommand("", command.shift(), command);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (targetType == "nodejs")
|
else if (targetType == "nodejs")
|
||||||
{
|
{
|
||||||
@@ -350,7 +367,7 @@ class LinuxPlatform extends PlatformTarget
|
|||||||
|
|
||||||
context.NEKO_FILE = targetDirectory + "/obj/ApplicationMain.n";
|
context.NEKO_FILE = targetDirectory + "/obj/ApplicationMain.n";
|
||||||
context.NODE_FILE = targetDirectory + "/bin/ApplicationMain.js";
|
context.NODE_FILE = targetDirectory + "/bin/ApplicationMain.js";
|
||||||
context.HL_FILE = targetDirectory + "/obj/ApplicationMain.hl";
|
context.HL_FILE = targetDirectory + "/obj/ApplicationMain" + (project.defines.exists("hlc") ? ".c" : ".hl");
|
||||||
context.CPP_DIR = targetDirectory + "/obj/";
|
context.CPP_DIR = targetDirectory + "/obj/";
|
||||||
context.BUILD_DIR = project.app.path + "/linux" + (is64 ? "64" : "") + (isRaspberryPi ? "-rpi" : "");
|
context.BUILD_DIR = project.app.path + "/linux" + (is64 ? "64" : "") + (isRaspberryPi ? "-rpi" : "");
|
||||||
context.WIN_ALLOW_SHADERS = false;
|
context.WIN_ALLOW_SHADERS = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user