Use frameworks for SDL if requested and available

This commit is contained in:
Michael Martin
2019-11-16 22:15:14 -08:00
parent 7907e36fd4
commit 2ad10b9906
+16 -4
View File
@@ -66,6 +66,15 @@ case "$HOST_SYSTEM" in
LIB_SDL_VERSION='1.2.13'
LIB_SDL_DETECT="true"
;;
Darwin)
if not have_framework SDL; then
LIB_SDL_DETECT="have_command sdl-config"
LIB_SDL_CFLAGS='$(sdl-config --cflags)'
LIB_SDL_LDFLAGS='$(sdl-config --libs)'
LIB_SDL_VERSION='$(sdl-config --version)'
fi
LIB_SDL_LDFLAGS="$LIB_SDL_LDFLAGS -lobjc -framework Cocoa"
;;
*)
LIB_SDL_DETECT="have_command sdl-config"
LIB_SDL_CFLAGS='$(sdl-config --cflags)'
@@ -82,10 +91,13 @@ case "$HOST_SYSTEM" in
LIB_SDL2_DETECT="false"
;;
Darwin)
LIB_SDL2_DETECT="have_command sdl2-config"
LIB_SDL2_CFLAGS='$(sdl2-config --cflags)'
LIB_SDL2_LDFLAGS='$(sdl2-config --static-libs)'
LIB_SDL2_VERSION='$(sdl2-config --version)'
if not have_framework SDL2; then
LIB_SDL2_DETECT="have_command sdl2-config"
LIB_SDL2_CFLAGS='$(sdl2-config --cflags)'
LIB_SDL2_LDFLAGS='$(sdl2-config --libs)'
LIB_SDL2_VERSION='$(sdl2-config --version)'
fi
LIB_SDL2_LDFLAGS="$LIB_SDL2_LDFLAGS -lobjc -framework Cocoa"
;;
*)
LIB_SDL2_DETECT="have_command sdl2-config"