Enabled sfml-audio on iOS
This commit is contained in:
parent
f17ea5872b
commit
6ab8d43b04
@ -31,8 +31,13 @@
|
||||
#include <SFML/Config.hpp>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <al.h>
|
||||
#include <alc.h>
|
||||
#ifdef SFML_SYSTEM_IOS
|
||||
#include <OpenAl/al.h>
|
||||
#include <OpenAl/alc.h>
|
||||
#else
|
||||
#include <al.h>
|
||||
#include <alc.h>
|
||||
#endif
|
||||
|
||||
|
||||
namespace sf
|
||||
|
@ -67,7 +67,9 @@ endif()
|
||||
|
||||
# find external libraries
|
||||
if(NOT SFML_OS_ANDROID)
|
||||
if(NOT SFML_OS_IOS)
|
||||
find_package(OpenAL REQUIRED)
|
||||
endif()
|
||||
find_package(Vorbis REQUIRED)
|
||||
find_package(FLAC REQUIRED)
|
||||
else()
|
||||
@ -75,17 +77,25 @@ else()
|
||||
find_host_package(Vorbis REQUIRED)
|
||||
find_host_package(FLAC REQUIRED)
|
||||
endif()
|
||||
include_directories(${OPENAL_INCLUDE_DIR})
|
||||
|
||||
if(NOT SFML_OS_IOS)
|
||||
include_directories(${OPENAL_INCLUDE_DIR})
|
||||
endif()
|
||||
include_directories(${VORBIS_INCLUDE_DIRS})
|
||||
include_directories(${FLAC_INCLUDE_DIR})
|
||||
add_definitions(-DOV_EXCLUDE_STATIC_CALLBACKS) # avoids warnings in vorbisfile.h
|
||||
add_definitions(-DFLAC__NO_DLL)
|
||||
|
||||
# build the list of external libraries to link
|
||||
if(SFML_OS_IOS)
|
||||
list(APPEND AUDIO_EXT_LIBS "-framework OpenAL")
|
||||
else()
|
||||
list(APPEND AUDIO_EXT_LIBS ${OPENAL_LIBRARY})
|
||||
endif()
|
||||
if(SFML_OS_ANDROID)
|
||||
list(APPEND AUDIO_EXT_LIBS android OpenSLES)
|
||||
endif()
|
||||
list(APPEND AUDIO_EXT_LIBS ${OPENAL_LIBRARY} ${VORBIS_LIBRARIES} ${FLAC_LIBRARY})
|
||||
list(APPEND AUDIO_EXT_LIBS ${VORBIS_LIBRARIES} ${FLAC_LIBRARY})
|
||||
|
||||
# define the sfml-audio target
|
||||
sfml_add_library(sfml-audio
|
||||
|
@ -48,6 +48,4 @@ endif()
|
||||
add_subdirectory(Window)
|
||||
add_subdirectory(Network)
|
||||
add_subdirectory(Graphics)
|
||||
if(NOT SFML_OS_IOS)
|
||||
add_subdirectory(Audio)
|
||||
endif()
|
||||
add_subdirectory(Audio)
|
||||
|
Loading…
Reference in New Issue
Block a user