Fix macOS link: use ld64 flags instead of GNU ld ones
ld64.lld rejects --allow-shlib-undefined and -rpath=$ORIGIN. Add a macOS branch with -undefined dynamic_lookup and an @executable_path rpath, and skip the Linux-only patchelf step in the justfile. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
a54101b48e
commit
2de47f0db9
2 files changed
+10
-2
No files matched your search
+5
-2
@@ -144,9 +144,12 @@ def sdlLinkLibs : TargetArray Dynlib := #[libSDL3, libSDL3Image, libSDL3Ttf, lib
|
||||
|
||||
-- make sure to copy these link args into whatever project is using this library in order for it to work
|
||||
-- This is because without "-rpath=$ORIGIN", the Linux executable will not load dynlibs next to the executable (i.e., the SDL ones you've copied there).
|
||||
def sdlLinkArgs : Array String := if Platform.isWindows
|
||||
then
|
||||
-- macOS's ld64 spells both flags differently: `-undefined dynamic_lookup` and `@executable_path` in place of `$ORIGIN`.
|
||||
def sdlLinkArgs : Array String :=
|
||||
if Platform.isWindows then
|
||||
#[]
|
||||
else if Platform.isOSX then
|
||||
#["-Wl,-undefined,dynamic_lookup", "-Wl,-rpath,@executable_path"]
|
||||
else
|
||||
#["-Wl,--allow-shlib-undefined", "-Wl,-rpath=$ORIGIN"]
|
||||
|
||||
|
||||
Reference in new issue
Block a user