diff --git a/tools/platforms/MacPlatform.hx b/tools/platforms/MacPlatform.hx index 3737419d4d..36054c63ae 100644 --- a/tools/platforms/MacPlatform.hx +++ b/tools/platforms/MacPlatform.hx @@ -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)