mirror of
https://github.com/mpv-player/mpv
synced 2025-01-09 00:19:32 +00:00
ao_openal: enable building on OSX
Signed-off-by: Josh de Kock <josh@itanimul.li>
This commit is contained in:
parent
d080851a30
commit
af6126adbe
@ -24,6 +24,19 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifndef AL_FORMAT_MONO_FLOAT32
|
||||
#define AL_FORMAT_MONO_FLOAT32 0x10010
|
||||
#endif
|
||||
#ifndef AL_FORMAT_STEREO_FLOAT32
|
||||
#define AL_FORMAT_STEREO_FLOAT32 0x10011
|
||||
#endif
|
||||
#ifndef AL_FORMAT_MONO_DOUBLE_EXT
|
||||
#define AL_FORMAT_MONO_DOUBLE_EXT 0x10012
|
||||
#endif
|
||||
#include <OpenAL/MacOSX_OALExtensions.h>
|
||||
#else
|
||||
#ifdef OPENAL_AL_H
|
||||
#include <OpenAL/alc.h>
|
||||
#include <OpenAL/al.h>
|
||||
@ -33,6 +46,7 @@
|
||||
#include <AL/al.h>
|
||||
#include <AL/alext.h>
|
||||
#endif
|
||||
#endif // __APPLE__
|
||||
|
||||
#include "common/msg.h"
|
||||
|
||||
|
@ -4,7 +4,7 @@ from waflib import Utils
|
||||
import os
|
||||
|
||||
__all__ = ["check_pthreads", "check_iconv", "check_lua", "check_oss_4front",
|
||||
"check_cocoa"]
|
||||
"check_cocoa", "check_openal"]
|
||||
|
||||
pthreads_program = load_fragment('pthreads.c')
|
||||
|
||||
@ -116,3 +116,14 @@ def check_cocoa(ctx, dependency_identifier):
|
||||
linkflags = '-fobjc-arc')
|
||||
|
||||
return fn(ctx, dependency_identifier)
|
||||
|
||||
def check_openal(ctx, dependency_identifier):
|
||||
checks = [
|
||||
check_pkg_config('openal', '>= 1.13'),
|
||||
check_statement(['OpenAL/AL.h'], 'int i = AL_VERSION', framework='OpenAL')
|
||||
]
|
||||
|
||||
for fn in checks:
|
||||
if fn(ctx, dependency_identifier):
|
||||
return True
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user