Skip to content
Permalink
Browse files

Hopefully fixed the cmake build on Mac OS X

  • Loading branch information
slouken committed Sep 15, 2016
1 parent 8c01d58 commit 93d42e2d3e643a88d8a51c7a0ad28dfbb10f6a6e
Showing with 9 additions and 27 deletions.
  1. +5 −15 CMakeLists.txt
  2. +2 −6 configure
  3. +2 −6 configure.in
@@ -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/ ?
$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
$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
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
@@ -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

0 comments on commit 93d42e2

Please sign in to comment.