From 668b3f7ba7dc7da3c20b7241e0bf1a7ddfea73c3 Mon Sep 17 00:00:00 2001 From: Apprentice-Alchemist <53486764+Apprentice-Alchemist@users.noreply.github.com> Date: Fri, 15 Apr 2022 09:13:08 +0200 Subject: [PATCH] Fix the HashlinkHelper --- src/lime/tools/HashlinkHelper.hx | 9 ++++++--- tools/platforms/MacPlatform.hx | 14 -------------- tools/platforms/WindowsPlatform.hx | 24 ------------------------ 3 files changed, 6 insertions(+), 41 deletions(-) diff --git a/src/lime/tools/HashlinkHelper.hx b/src/lime/tools/HashlinkHelper.hx index a1496f1cb..389aa3649 100644 --- a/src/lime/tools/HashlinkHelper.hx +++ b/src/lime/tools/HashlinkHelper.hx @@ -16,6 +16,7 @@ class HashlinkHelper if (hlPath == null) { System.recursiveCopyTemplate(project.templatePaths, 'bin/hl/$platform', applicationDirectory); + System.renameFile(Path.combine(applicationDirectory, "hl" + (platform == WINDOWS ? ".exe" : "")), executablePath); } else { @@ -43,13 +44,15 @@ class HashlinkHelper } } - // make sure no hxcpp hash files remain + // make sure no hxcpp hash files or MSVC build artifacts remain for (file in System.readDirectory(applicationDirectory)) { - if (Path.extension(file) == "hash") + switch Path.extension(file) { - System.deleteFile(file); + case "hash", "lib", "pdb", "ilk", "exp": + System.deleteFile(file); + default: } } System.copyFile(targetDirectory + "/obj/ApplicationMain.hl", Path.combine(applicationDirectory, "hlboot.dat")); diff --git a/tools/platforms/MacPlatform.hx b/tools/platforms/MacPlatform.hx index 1158ec966..6b5d867ef 100644 --- a/tools/platforms/MacPlatform.hx +++ b/tools/platforms/MacPlatform.hx @@ -207,20 +207,6 @@ class MacPlatform extends PlatformTarget if (noOutput) return; HashlinkHelper.copyHashlink(project, targetDirectory, applicationDirectory, executablePath); - - // // System.copyFile(targetDirectory + "/obj/ApplicationMain" + (project.debug ? "-Debug" : "") + ".hl", - // // Path.combine(executableDirectory, project.app.file + ".hl")); - // System.recursiveCopyTemplate(project.templatePaths, "bin/hl/mac", executableDirectory); - // // let's not keep around hxcpp's hash files - // for (file in System.readDirectory(applicationDirectory)) - // { - // if (Path.extension(file) == "hash") - // { - // System.deleteFile(file); - // } - // } - // System.copyFile(targetDirectory + "/obj/ApplicationMain.hl", Path.combine(executableDirectory, "hlboot.dat")); - // System.renameFile(Path.combine(executableDirectory, "hl"), executablePath); } else if (targetType == "java") { diff --git a/tools/platforms/WindowsPlatform.hx b/tools/platforms/WindowsPlatform.hx index a64eebfb5..12c4bb345 100644 --- a/tools/platforms/WindowsPlatform.hx +++ b/tools/platforms/WindowsPlatform.hx @@ -297,17 +297,6 @@ class WindowsPlatform extends PlatformTarget { ProjectHelper.copyLibrary(project, ndll, "Windows" + (is64 ? "64" : ""), "", ".hdll", applicationDirectory, project.debug, targetSuffix); - - if (!project.environment.exists("HL_PATH")) - { - var command = #if lime "lime" #else "hxp" #end; - - Log.warn("You must define HL_PATH to copy HashLink dependencies, please run '" + command + " setup hl' first"); - } - else - { - System.copyFile(project.environment.get("HL_PATH") + '/ssl.hdll', applicationDirectory + '/ssl.hdll'); - } } else { @@ -344,19 +333,6 @@ class WindowsPlatform extends PlatformTarget HashlinkHelper.copyHashlink(project, targetDirectory, applicationDirectory, executablePath); - // System.copyFile(targetDirectory + "/obj/ApplicationMain.hl", Path.combine(applicationDirectory, project.app.file + ".hl")); - // System.recursiveCopyTemplate(project.templatePaths, "bin/hl/windows", applicationDirectory); - // System.copyFile(targetDirectory + "/obj/ApplicationMain.hl", Path.combine(applicationDirectory, "hlboot.dat")); - // System.renameFile(Path.combine(applicationDirectory, "hl.exe"), executablePath); - // let's not keep around hxcpp's hash files - for (file in System.readDirectory(applicationDirectory)) - { - if (Path.extension(file) == "hash") - { - System.deleteFile(file); - } - } - var iconPath = Path.combine(applicationDirectory, "icon.ico"); if (IconHelper.createWindowsIcon(icons, iconPath) && System.hostPlatform == WINDOWS)