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,33 +6,33 @@ set(SRCS Src/AudioCommon.cpp
set(LIBS "")
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(SRCS ${SRCS} Src/CoreAudioSoundStream.cpp)
else()
if(ALSA_FOUND)
if(ALSA_FOUND)
set(SRCS ${SRCS} Src/AlsaSoundStream.cpp)
set(LIBS ${LIBS} ${ALSA_LIBRARIES})
endif(ALSA_FOUND)
endif(ALSA_FOUND)
if(AO_FOUND)
if(AO_FOUND)
set(SRCS ${SRCS} Src/AOSoundStream.cpp)
set(LIBS ${LIBS} ${AO_LIBRARIES})
endif(AO_FOUND)
endif(AO_FOUND)
if(OPENAL_FOUND)
if(OPENAL_FOUND)
set(SRCS ${SRCS} Src/OpenALStream.cpp Src/aldlist.cpp)
set(LIBS ${LIBS} openal)
endif(OPENAL_FOUND)
set(LIBS ${LIBS} ${OPENAL_LIBRARY})
endif(OPENAL_FOUND)
if(PULSEAUDIO_FOUND)
if(PULSEAUDIO_FOUND)
set(SRCS ${SRCS} Src/PulseAudioStream.cpp)
set(LIBS ${LIBS} ${PULSEAUDIO_LIBRARIES})
endif(PULSEAUDIO_FOUND)
endif(PULSEAUDIO_FOUND)
if(WIN32)
if(WIN32)
set(SRCS ${SRCS} Src/DSoundStream.cpp)
set(SRCS ${SRCS} Src/XAudio2Stream.cpp)
endif(WIN32)
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>