Hopefully fixed the cmake build on Mac OS X
authorSam Lantinga <slouken@libsdl.org>
Thu, 15 Sep 2016 08:46:14 -0700
changeset 1034858e8745fb4e1
parent 10347 221061d874e9
child 10349 4b978b7998aa
Hopefully fixed the cmake build on Mac OS X
CMakeLists.txt
configure
configure.in
     1.1 --- a/CMakeLists.txt	Thu Sep 15 08:29:20 2016 -0700
     1.2 +++ b/CMakeLists.txt	Thu Sep 15 08:46:14 2016 -0700
     1.3 @@ -1206,12 +1206,10 @@
     1.4  
     1.5    if(SDL_AUDIO)
     1.6      set(SDL_AUDIO_DRIVER_COREAUDIO 1)
     1.7 -    file(GLOB AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/coreaudio/*.c)
     1.8 +    file(GLOB AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/coreaudio/*.m)
     1.9      set(SOURCE_FILES ${SOURCE_FILES} ${AUDIO_SOURCES})
    1.10      set(HAVE_SDL_AUDIO TRUE)
    1.11 -    set(SDL_FRAMEWORK_COREAUDIO 1)
    1.12 -    set(SDL_FRAMEWORK_AUDIOUNIT 1)
    1.13 -    set(SDL_FRAMEWORK_AUDIOTOOLBOX 1)
    1.14 +    set(SDL_FRAMEWORK_AVFOUNDATION 1)
    1.15    endif()
    1.16  
    1.17    if(SDL_JOYSTICK)
    1.18 @@ -1280,17 +1278,9 @@
    1.19      find_library(CARBON_LIBRARY Carbon)
    1.20      list(APPEND EXTRA_LIBS ${CARBON_LIBRARY})
    1.21    endif()
    1.22 -  if(SDL_FRAMEWORK_COREAUDIO)
    1.23 -    find_library(COREAUDIO CoreAudio)
    1.24 -    list(APPEND EXTRA_LIBS ${COREAUDIO})
    1.25 -  endif()
    1.26 -  if(SDL_FRAMEWORK_AUDIOUNIT)
    1.27 -    find_library(AUDIOUNIT AudioUnit)
    1.28 -    list(APPEND EXTRA_LIBS ${AUDIOUNIT})
    1.29 -  endif()
    1.30 -  if(SDL_FRAMEWORK_AUDIOTOOLBOX)
    1.31 -    find_library(AUDIOTOOLBOX AudioToolbox)
    1.32 -    list(APPEND EXTRA_LIBS ${AUDIOTOOLBOX})
    1.33 +  if(SDL_FRAMEWORK_AVFOUNDATION)
    1.34 +    find_library(AVFOUNDATION AVFoundation)
    1.35 +    list(APPEND EXTRA_LIBS ${AVFOUNDATION})
    1.36    endif()
    1.37  
    1.38    # iOS hack needed - http://code.google.com/p/ios-cmake/ ?
     2.1 --- a/configure	Thu Sep 15 08:29:20 2016 -0700
     2.2 +++ b/configure	Thu Sep 15 08:46:14 2016 -0700
     2.3 @@ -23529,9 +23529,9 @@
     2.4  $as_echo "#define SDL_AUDIO_DRIVER_COREAUDIO 1" >>confdefs.h
     2.5  
     2.6              SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m"
     2.7 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AVFoundation"
     2.8              SUMMARY_audio="${SUMMARY_audio} coreaudio"
     2.9              have_audio=yes
    2.10 -            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AVFoundation"
    2.11          fi
    2.12          # Set up files for the joystick library
    2.13          if test x$enable_joystick = xyes; then
    2.14 @@ -23547,8 +23547,8 @@
    2.15  $as_echo "#define SDL_HAPTIC_IOKIT 1" >>confdefs.h
    2.16  
    2.17              SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
    2.18 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
    2.19              have_haptic=yes
    2.20 -            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
    2.21          fi
    2.22          # Set up files for the power library
    2.23          if test x$enable_power = xyes; then
    2.24 @@ -23585,10 +23585,6 @@
    2.25          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
    2.26          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
    2.27          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
    2.28 -        # If audio is used, add the AudioUnit framework
    2.29 -        if test x$enable_audio = xyes; then
    2.30 -            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit"
    2.31 -        fi
    2.32          ;;
    2.33      *-nacl|*-pnacl)
    2.34          ARCH=nacl
     3.1 --- a/configure.in	Thu Sep 15 08:29:20 2016 -0700
     3.2 +++ b/configure.in	Thu Sep 15 08:46:14 2016 -0700
     3.3 @@ -3316,9 +3316,9 @@
     3.4          if test x$enable_audio = xyes; then
     3.5              AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
     3.6              SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m"
     3.7 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AVFoundation"
     3.8              SUMMARY_audio="${SUMMARY_audio} coreaudio"
     3.9              have_audio=yes
    3.10 -            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AVFoundation"
    3.11          fi
    3.12          # Set up files for the joystick library
    3.13          if test x$enable_joystick = xyes; then
    3.14 @@ -3330,8 +3330,8 @@
    3.15          if test x$enable_haptic = xyes; then
    3.16              AC_DEFINE(SDL_HAPTIC_IOKIT, 1, [ ])
    3.17              SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
    3.18 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
    3.19              have_haptic=yes
    3.20 -            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
    3.21          fi
    3.22          # Set up files for the power library
    3.23          if test x$enable_power = xyes; then
    3.24 @@ -3362,10 +3362,6 @@
    3.25          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
    3.26          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
    3.27          EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
    3.28 -        # If audio is used, add the AudioUnit framework
    3.29 -        if test x$enable_audio = xyes; then
    3.30 -            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit"
    3.31 -        fi
    3.32          ;;
    3.33      *-nacl|*-pnacl)
    3.34          ARCH=nacl