Skip to content

Commit

Permalink
ruby: try using homebrew for SDL in local builds on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
rasky committed Feb 13, 2024
1 parent 5864382 commit 2341716
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ruby/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,18 @@ ifeq ($(ruby),)
ruby += input.quartz #input.carbon
ifeq ($(sdl2),true)
macsdl = ../thirdparty/SDL/libSDL2-2.0.0.dylib
ares.dylibs += $(macsdl)
ifeq ($(wildcard $(macsdl)),)
$(error Tried to compile ruby for macOS with SDL2 linked, but no SDL2 library was found. Compile it with thirdparty/SDL/build-sdl.sh, or disable SDL by compiling ares with sdl2=false)
ifeq ($(local),true)
sdl2prefix = $(shell brew --prefix sdl2)
ifneq ($(sdl2prefix),)
macsdl = $(sdl2prefix)/lib/libSDL2-2.0.0.dylib
endif
endif
endif
ifeq ($(wildcard $(macsdl)),)
$(error Tried to compile ruby for macOS with SDL2 linked, but no SDL2 library was found. Install it with homebrew, or compile it with thirdparty/SDL/build-sdl.sh, or disable SDL by compiling ares with sdl2=false)
endif
ares.dylibs += $(macsdl)
ruby += input.sdl
endif
else ifeq ($(platform),linux)
Expand Down

0 comments on commit 2341716

Please sign in to comment.