Skip to content

Commit

Permalink
fix ffi libsdl2 candidate order and paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrm committed Mar 22, 2023
1 parent d7d09ee commit 7b7a609
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ffi/SDL2_0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ require("ffi/linux_input_h")
-----------------------------------------------------------------

local SDL = util.ffiLoadCandidates{
"/usr/local/opt/lib/libSDL2.dylib",
"/opt/homebrew/lib/libSDL2.dylib",
"SDL2",
-- this unfortunately needs to be written in full due to the . in the name
"libSDL2-2.0.so",
"libSDL2-2.0.so.0",
"/usr/local/opt/lib/libSDL2.dylib",
"/opt/homebrew/lib/libSDL2.dylib",
}

-- Some features (like SDL_GameControllerRumble) may require a minimum version
Expand Down
2 changes: 1 addition & 1 deletion ffi/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ function util.haveSDL2()
if haveSDL2 == nil then
local candidates
if jit.os == "OSX" then
candidates = {"/opt/homebrew/lib/libSDL2.dylib", "SDL2"}
candidates = {"libs/libSDL2.dylib", "/opt/homebrew/lib/libSDL2.dylib", "SDL2"}
else
candidates = {"SDL2", "libSDL2-2.0.so", "libSDL2-2.0.so.0"}
end
Expand Down

0 comments on commit 7b7a609

Please sign in to comment.