From 93d42e2d3e643a88d8a51c7a0ad28dfbb10f6a6e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 15 Sep 2016 08:46:14 -0700 Subject: [PATCH] Hopefully fixed the cmake build on Mac OS X --- CMakeLists.txt | 20 +++++--------------- configure | 8 ++------ configure.in | 8 ++------ 3 files changed, 9 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e45d9f2a8..ba2e3705a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1206,12 +1206,10 @@ elseif(APPLE) if(SDL_AUDIO) set(SDL_AUDIO_DRIVER_COREAUDIO 1) - file(GLOB AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/coreaudio/*.c) + file(GLOB AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/coreaudio/*.m) set(SOURCE_FILES ${SOURCE_FILES} ${AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) - set(SDL_FRAMEWORK_COREAUDIO 1) - set(SDL_FRAMEWORK_AUDIOUNIT 1) - set(SDL_FRAMEWORK_AUDIOTOOLBOX 1) + set(SDL_FRAMEWORK_AVFOUNDATION 1) endif() if(SDL_JOYSTICK) @@ -1280,17 +1278,9 @@ elseif(APPLE) find_library(CARBON_LIBRARY Carbon) list(APPEND EXTRA_LIBS ${CARBON_LIBRARY}) endif() - if(SDL_FRAMEWORK_COREAUDIO) - find_library(COREAUDIO CoreAudio) - list(APPEND EXTRA_LIBS ${COREAUDIO}) - endif() - if(SDL_FRAMEWORK_AUDIOUNIT) - find_library(AUDIOUNIT AudioUnit) - list(APPEND EXTRA_LIBS ${AUDIOUNIT}) - endif() - if(SDL_FRAMEWORK_AUDIOTOOLBOX) - find_library(AUDIOTOOLBOX AudioToolbox) - list(APPEND EXTRA_LIBS ${AUDIOTOOLBOX}) + if(SDL_FRAMEWORK_AVFOUNDATION) + find_library(AVFOUNDATION AVFoundation) + list(APPEND EXTRA_LIBS ${AVFOUNDATION}) endif() # iOS hack needed - http://code.google.com/p/ios-cmake/ ? diff --git a/configure b/configure index 940351011..bdad5e54f 100755 --- a/configure +++ b/configure @@ -23529,9 +23529,9 @@ $as_echo "#define SDL_FILESYSTEM_HAIKU 1" >>confdefs.h $as_echo "#define SDL_AUDIO_DRIVER_COREAUDIO 1" >>confdefs.h SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AVFoundation" SUMMARY_audio="${SUMMARY_audio} coreaudio" have_audio=yes - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AVFoundation" fi # Set up files for the joystick library if test x$enable_joystick = xyes; then @@ -23547,8 +23547,8 @@ $as_echo "#define SDL_JOYSTICK_IOKIT 1" >>confdefs.h $as_echo "#define SDL_HAPTIC_IOKIT 1" >>confdefs.h SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c" - have_haptic=yes EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback" + have_haptic=yes fi # Set up files for the power library if test x$enable_power = xyes; then @@ -23585,10 +23585,6 @@ $as_echo "#define SDL_TIMER_UNIX 1" >>confdefs.h EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit" - # If audio is used, add the AudioUnit framework - if test x$enable_audio = xyes; then - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit" - fi ;; *-nacl|*-pnacl) ARCH=nacl diff --git a/configure.in b/configure.in index 082b8b5d7..76f89793c 100644 --- a/configure.in +++ b/configure.in @@ -3316,9 +3316,9 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau if test x$enable_audio = xyes; then AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AVFoundation" SUMMARY_audio="${SUMMARY_audio} coreaudio" have_audio=yes - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AVFoundation" fi # Set up files for the joystick library if test x$enable_joystick = xyes; then @@ -3330,8 +3330,8 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau if test x$enable_haptic = xyes; then AC_DEFINE(SDL_HAPTIC_IOKIT, 1, [ ]) SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c" - have_haptic=yes EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback" + have_haptic=yes fi # Set up files for the power library if test x$enable_power = xyes; then @@ -3362,10 +3362,6 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit" - # If audio is used, add the AudioUnit framework - if test x$enable_audio = xyes; then - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit" - fi ;; *-nacl|*-pnacl) ARCH=nacl