Skip to content

Commit

Permalink
Revert "MacPlatform: use install_name_tool to add /usr/local/lib and …
Browse files Browse the repository at this point in the history
…/opt/hombrew/lib to rpath of lime.ndll"

This reverts commit 4793649.

Didn't work with Haxe/Neko installed from Apple Silicon Homebrew because Lime tools couldn't link to Neko.
  • Loading branch information
joshtynjala committed Jul 8, 2024
1 parent 0ef949f commit 84d7f39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
7 changes: 7 additions & 0 deletions project/Build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,13 @@
</section>

<section if="mac">
<!--
starting in xcode 15, rpath doesn't automatically include
/usr/local/lib, but we need it for neko
-->
<vflag name="-rpath" value="/usr/local/lib" />
<vflag name="-rpath" value="/opt/homebrew/lib" if="HXCPP_ARM64"/>

<vflag name="-l" value="iconv" />
<vflag name="-framework" value="IOKit" />
<vflag name="-framework" value="Foundation" />
Expand Down
12 changes: 0 additions & 12 deletions tools/platforms/MacPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package;

import lime.tools.HashlinkHelper;
import hxp.Haxelib;
import hxp.HostArchitecture;
import hxp.HXML;
import hxp.Log;
import hxp.Path;
Expand Down Expand Up @@ -189,17 +188,6 @@ class MacPlatform extends PlatformTarget

NekoHelper.createExecutable(project.templatePaths, "mac" + dirSuffix.toLowerCase(), targetDirectory + "/obj/ApplicationMain.n", executablePath);
NekoHelper.copyLibraries(project.templatePaths, "mac" + dirSuffix.toLowerCase(), executableDirectory);

// starting in xcode 15, rpath doesn't automatically include
// /usr/local/lib, but we need it for libneko dylib
System.runCommand("", "install_name_tool", ["-add_rpath", "/usr/local/lib", Path.join([executableDirectory, "lime.ndll"])]);
if (System.hostArchitecture == HostArchitecture.ARM64)
{
// on Apple Silicon, the user may have installed Neko with
// Homebrew, which has a different path. however, if the
// Homebrew path doesn't exist, that's okay.
System.runCommand("", "install_name_tool", ["-add_rpath", "/opt/homebrew/lib", Path.join([executableDirectory, "lime.ndll"])]);
}
}
else if (targetType == "hl")
{
Expand Down

0 comments on commit 84d7f39

Please sign in to comment.