From 2ad10b9906494667072570466773bd01aec907f5 Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Sat, 16 Nov 2019 22:15:14 -0800 Subject: [PATCH] Use frameworks for SDL if requested and available --- sc2/build/unix/config_proginfo_host | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/sc2/build/unix/config_proginfo_host b/sc2/build/unix/config_proginfo_host index 709594e5d..722fc65f4 100644 --- a/sc2/build/unix/config_proginfo_host +++ b/sc2/build/unix/config_proginfo_host @@ -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"