Merge pull request #1661 from tobil4sk/mingw-fixes-develop

Allow cross compiling Windows projects with MinGW
This commit is contained in:
player-03
2024-01-12 13:56:37 -05:00
committed by GitHub
3 changed files with 22 additions and 4 deletions

View File

@@ -138,7 +138,7 @@ class WindowsPlatform extends PlatformTarget
{
targetType = "winjs";
}
else if (project.targetFlags.exists("neko") || project.target != cast System.hostPlatform)
else if (project.targetFlags.exists("neko"))
{
targetType = "neko";
}
@@ -496,6 +496,24 @@ class WindowsPlatform extends PlatformTarget
CPPHelper.compile(project, targetDirectory + "/obj", flags);
System.copyFile(targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-debug" : "") + ".exe", executablePath);
if (project.targetFlags.exists("mingw"))
{
var libraries = ["libwinpthread-1.dll", "libstdc++-6.dll"];
if (is64)
{
libraries.push("libgcc_s_seh-1.dll");
}
else
{
libraries.push("libgcc_s_dw2-1.dll");
}
for (library in libraries)
{
System.copyIfNewer(targetDirectory + "/obj/" + library, Path.combine(applicationDirectory, library));
}
}
}
else
{