diff --git a/src/lime/tools/HashlinkHelper.hx b/src/lime/tools/HashlinkHelper.hx index c897f8a7f..71302e078 100644 --- a/src/lime/tools/HashlinkHelper.hx +++ b/src/lime/tools/HashlinkHelper.hx @@ -98,8 +98,13 @@ class HashlinkHelper { switch Path.extension(file) { - case "hash", "lib", "pdb", "ilk", "exp": + case "hash", "pdb", "ilk", "exp": System.deleteFile(file); + case "lib": + if (platform != WINDOWS) + { + System.deleteFile(file); + } default: } } diff --git a/tools/platforms/WindowsPlatform.hx b/tools/platforms/WindowsPlatform.hx index d13b27baf..f87c5a2cc 100644 --- a/tools/platforms/WindowsPlatform.hx +++ b/tools/platforms/WindowsPlatform.hx @@ -297,6 +297,8 @@ class WindowsPlatform extends PlatformTarget { ProjectHelper.copyLibrary(project, ndll, "Windows" + (is64 ? "64" : ""), "", ".hdll", applicationDirectory, project.debug, targetSuffix); + ProjectHelper.copyLibrary(project, ndll, "Windows" + (is64 ? "64" : ""), "", ".lib", applicationDirectory, project.debug, + ".lib"); } else { @@ -335,20 +337,51 @@ class WindowsPlatform extends PlatformTarget if (project.targetFlags.exists("hlc")) { - var command = ["gcc", "-O3", "-o", executablePath, "-std=c11", "-Wl,-subsystem,windows", "-I", Path.combine(targetDirectory, "obj"), Path.combine(targetDirectory, "obj/ApplicationMain.c"), "C:/Windows/System32/dbghelp.dll"]; - for (file in System.readDirectory(applicationDirectory)) + var command:Array = null; + if (project.targetFlags.exists("gcc")) { - switch Path.extension(file) + command = ["gcc", "-O3", "-o", executablePath, "-std=c11", "-Wl,-subsystem,windows", "-I", Path.combine(targetDirectory, "obj"), Path.combine(targetDirectory, "obj/ApplicationMain.c"), "C:/Windows/System32/dbghelp.dll"]; + for (file in System.readDirectory(applicationDirectory)) { - case "dll", "hdll": - // ensure the executable knows about every library - command.push(file); - default: + switch Path.extension(file) + { + case "dll", "hdll": + // ensure the executable knows about every library + command.push(file); + default: + } } } + else + { + command = ["cl.exe", "/Ox", "/Fe:" + executablePath, "-I", Path.combine(targetDirectory, "obj"), Path.combine(targetDirectory, "obj/ApplicationMain.c")]; + for (file in System.readDirectory(applicationDirectory)) + { + switch Path.extension(file) + { + case "lib": + // ensure the executable knows about every library + command.push(file); + default: + } + } + command.push("/link"); + command.push("/subsystem:windows"); + } System.runCommand("", command.shift(), command); } + for (file in System.readDirectory(applicationDirectory)) + { + switch Path.extension(file) + { + case "lib": + // lib files required only for hlc compilation + System.deleteFile(file); + default: + } + } + var iconPath = Path.combine(applicationDirectory, "icon.ico"); if (IconHelper.createWindowsIcon(icons, iconPath) && System.hostPlatform == WINDOWS)