Hopefully fixed the cmake build on Mac OS X

This commit is contained in:
Sam Lantinga 2016-09-15 08:46:14 -07:00
parent 8c01d5886c
commit 93d42e2d3e
3 changed files with 9 additions and 27 deletions

View File

@ -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/ ?

8
configure vendored
View File

@ -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

View File

@ -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