Skip to content

Commit fa32742

Browse files
committed
add homebrew /opt location
1 parent 93a57cf commit fa32742

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/tsdl.ml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,15 @@ let lib_sdl2 =
5252
(* macOS *)
5353
trylib "/Library/Frameworks/SDL2.framework/SDL2"
5454
with _ -> begin try
55-
(* Homebrew on macOS *)
55+
(* Homebrew on macOS Intel *)
5656
trylib "/usr/local/lib/libSDL2.dylib"
57-
with _ -> begin
58-
print_endline "Could not find SDL2 library file.";
59-
None
57+
with _ -> begin try
58+
(* Homebrew Apple Silicon (M1/M2/M3) *)
59+
trylib "/opt/homebrew/lib/libSDL2.dylib"
60+
with _ -> begin
61+
print_endline "Could not find SDL2 library file.";
62+
None
63+
end
6064
end
6165
end
6266
end

0 commit comments

Comments
 (0)