Compile with OpenAL support on OS X.

This commit is contained in:
Maarten ter Huurne 2011-12-05 05:49:08 +01:00
parent 24dcb7922c
commit 958891b4eb
2 changed files with 28 additions and 25 deletions

View File

@ -6,9 +6,6 @@ set(SRCS Src/AudioCommon.cpp
set(LIBS "")
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(SRCS ${SRCS} Src/CoreAudioSoundStream.cpp)
else()
if(ALSA_FOUND)
set(SRCS ${SRCS} Src/AlsaSoundStream.cpp)
set(LIBS ${LIBS} ${ALSA_LIBRARIES})
@ -21,7 +18,7 @@ else()
if(OPENAL_FOUND)
set(SRCS ${SRCS} Src/OpenALStream.cpp Src/aldlist.cpp)
set(LIBS ${LIBS} openal)
set(LIBS ${LIBS} ${OPENAL_LIBRARY})
endif(OPENAL_FOUND)
if(PULSEAUDIO_FOUND)
@ -33,6 +30,9 @@ else()
set(SRCS ${SRCS} Src/DSoundStream.cpp)
set(SRCS ${SRCS} Src/XAudio2Stream.cpp)
endif(WIN32)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(SRCS ${SRCS} Src/CoreAudioSoundStream.cpp)
endif()
add_library(audiocommon STATIC ${SRCS})

View File

@ -27,6 +27,9 @@
#ifdef _WIN32
#include "../../../../Externals/OpenAL/include/al.h"
#include "../../../../Externals/OpenAL/include/alc.h"
#elif defined(__APPLE__)
#include <al.h>
#include <alc.h>
#else
#include <AL/al.h>
#include <AL/alc.h>