MacPlatform: fix error that says @rpath/libhl.dylib is not found when using HashLink nightly builds for HL/C

Added `@executable_path` to the rpath.
This commit is contained in:
Josh Tynjala
2024-11-20 15:43:58 -08:00
parent 61ec7d0913
commit 4812f6a1dd

View File

@@ -214,7 +214,7 @@ class MacPlatform extends PlatformTarget
// compiler command with the `arch -x86_64` command.
// if we ever support ARM or Universal binaries, this will
// need to be handled differently.
var command = ["arch", "-x86_64", compiler, "-O3", "-o", executablePath, "-std=c11", "-I", Path.combine(targetDirectory, "obj"), Path.combine(targetDirectory, "obj/ApplicationMain.c")];
var command = ["arch", "-x86_64", compiler, "-O3", "-o", executablePath, "-std=c11", "-Wl,-rpath,@executable_path", "-I", Path.combine(targetDirectory, "obj"), Path.combine(targetDirectory, "obj/ApplicationMain.c")];
for (file in System.readDirectory(executableDirectory))
{
switch Path.extension(file)