Try fixing macOS and support no_console Windows subsystem.

This commit is contained in:
Apprentice-Alchemist
2022-05-18 08:11:44 +02:00
parent 362ab26d18
commit b2546aac9f
4 changed files with 12 additions and 3 deletions

View File

@@ -12,6 +12,7 @@
<files id="hl"> <files id="hl">
<compilerflag value="-I${HASHLINK_PATH}/src" /> <compilerflag value="-I${HASHLINK_PATH}/src" />
<file name="src/hashlink_main.c" tag="main"/>
<file name="${HASHLINK_PATH}/src/code.c" /> <file name="${HASHLINK_PATH}/src/code.c" />
<file name="${HASHLINK_PATH}/src/debugger.c" /> <file name="${HASHLINK_PATH}/src/debugger.c" />
<file name="${HASHLINK_PATH}/src/jit.c" /> <file name="${HASHLINK_PATH}/src/jit.c" />
@@ -357,6 +358,7 @@
<files id="libhl" /> <files id="libhl" />
<ext value=".${LIBSUFFIX}" /> <ext value=".${LIBSUFFIX}" />
<vflag name="-install_name" value="@executable_path/libhl.dylib" if="mac"/>
<lib name="-pthread" if="linux" /> <lib name="-pthread" if="linux" />
<section if="windows"> <section if="windows">

View File

@@ -0,0 +1,7 @@
#ifdef HX_WIN_MAIN
extern int wmain(int argc, wchar_t *argv[]);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
return wmain(__argc, __argv);
}
#endif

View File

@@ -659,7 +659,7 @@ class WindowsPlatform extends PlatformTarget
if (!targetFlags.exists("32") if (!targetFlags.exists("32")
&& System.hostArchitecture == X64 && System.hostArchitecture == X64
&& (command != "rebuild" || targetType == "cpp" || targetType == "winrt")) && (command != "rebuild" || targetType == "cpp" || targetType == "hl" || targetType == "winrt"))
{ {
if (targetType == "winrt") if (targetType == "winrt")
{ {

View File

@@ -1207,7 +1207,7 @@ class PlatformSetup
var entitlementsPath = sys.FileSystem.exists(limePath + "/project") ? (limePath + var entitlementsPath = sys.FileSystem.exists(limePath + "/project") ? (limePath +
"/project/lib/hashlink/other/osx/entitlements.xml") : (limePath "/project/lib/hashlink/other/osx/entitlements.xml") : (limePath
+ "/templates/bin/hl/entitlements.xml"); + "/templates/bin/hl/entitlements.xml");
System.runCommand("", "sudo", ["security", "delete-identity", "-c", "hl-cert"], true, false, true); System.runCommand("", "sudo", ["security", "delete-identity", "-c", "hl-cert"], true, true, true);
sys.io.File.saveContent(openSSLConf, [ sys.io.File.saveContent(openSSLConf, [
"[req]", "[req]",
"distinguished_name=codesign_dn", "distinguished_name=codesign_dn",
@@ -1232,7 +1232,7 @@ class PlatformSetup
System.runCommand("", "codesign", ["--entitlements", entitlementsPath, "-fs", "hl-cert", hlPath], true, false, true); System.runCommand("", "codesign", ["--entitlements", entitlementsPath, "-fs", "hl-cert", hlPath], true, false, true);
for (f in [key, cert, openSSLConf]) for (f in [key, cert, openSSLConf])
sys.FileSystem.deleteFile(f); sys.FileSystem.deleteFile(f);
Log.println("\nIf you update lime, yo will have to run this again to sign the new hl executable"); Log.println("\nIf you update lime, you will have to run this again to sign the new hl executable");
} }
} }
} }