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) if(SDL_AUDIO)
set(SDL_AUDIO_DRIVER_COREAUDIO 1) 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(SOURCE_FILES ${SOURCE_FILES} ${AUDIO_SOURCES})
set(HAVE_SDL_AUDIO TRUE) set(HAVE_SDL_AUDIO TRUE)
set(SDL_FRAMEWORK_COREAUDIO 1) set(SDL_FRAMEWORK_AVFOUNDATION 1)
set(SDL_FRAMEWORK_AUDIOUNIT 1)
set(SDL_FRAMEWORK_AUDIOTOOLBOX 1)
endif() endif()
if(SDL_JOYSTICK) if(SDL_JOYSTICK)
@ -1280,17 +1278,9 @@ elseif(APPLE)
find_library(CARBON_LIBRARY Carbon) find_library(CARBON_LIBRARY Carbon)
list(APPEND EXTRA_LIBS ${CARBON_LIBRARY}) list(APPEND EXTRA_LIBS ${CARBON_LIBRARY})
endif() endif()
if(SDL_FRAMEWORK_COREAUDIO) if(SDL_FRAMEWORK_AVFOUNDATION)
find_library(COREAUDIO CoreAudio) find_library(AVFOUNDATION AVFoundation)
list(APPEND EXTRA_LIBS ${COREAUDIO}) list(APPEND EXTRA_LIBS ${AVFOUNDATION})
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})
endif() endif()
# iOS hack needed - http://code.google.com/p/ios-cmake/ ? # 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 $as_echo "#define SDL_AUDIO_DRIVER_COREAUDIO 1" >>confdefs.h
SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m" SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AVFoundation"
SUMMARY_audio="${SUMMARY_audio} coreaudio" SUMMARY_audio="${SUMMARY_audio} coreaudio"
have_audio=yes have_audio=yes
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AVFoundation"
fi fi
# Set up files for the joystick library # Set up files for the joystick library
if test x$enable_joystick = xyes; then 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 $as_echo "#define SDL_HAPTIC_IOKIT 1" >>confdefs.h
SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c" SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
have_haptic=yes
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
have_haptic=yes
fi fi
# Set up files for the power library # Set up files for the power library
if test x$enable_power = xyes; then 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,Cocoa"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit" 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) *-nacl|*-pnacl)
ARCH=nacl 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 if test x$enable_audio = xyes; then
AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ]) AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ])
SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m" SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.m"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AVFoundation"
SUMMARY_audio="${SUMMARY_audio} coreaudio" SUMMARY_audio="${SUMMARY_audio} coreaudio"
have_audio=yes have_audio=yes
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AVFoundation"
fi fi
# Set up files for the joystick library # Set up files for the joystick library
if test x$enable_joystick = xyes; then 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 if test x$enable_haptic = xyes; then
AC_DEFINE(SDL_HAPTIC_IOKIT, 1, [ ]) AC_DEFINE(SDL_HAPTIC_IOKIT, 1, [ ])
SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c" SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
have_haptic=yes
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
have_haptic=yes
fi fi
# Set up files for the power library # Set up files for the power library
if test x$enable_power = xyes; then 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,Cocoa"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit" 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) *-nacl|*-pnacl)
ARCH=nacl ARCH=nacl