1osxaudio_sources = [
2  'gstosxaudioringbuffer.c',
3  'gstosxaudioelement.c',
4  'gstosxaudiosink.c',
5  'gstosxaudiosrc.c',
6  'gstosxcoreaudiocommon.c',
7  'gstosxcoreaudio.c',
8  'gstosxaudio.c'
9]
10
11have_osxaudio = false
12osxaudio_option = get_option('osxaudio')
13if osxaudio_option.disabled() or not ['darwin', 'ios'].contains(host_system)
14  subdir_done()
15endif
16
17if host_system == 'darwin'
18  # TODO: https://github.com/mesonbuild/meson/issues/3940
19  have_osxaudio = cc.has_header('CoreAudio/CoreAudio.h')
20  osxaudio_sources += ['gstosxaudiodeviceprovider.c']
21elif host_system == 'ios'
22  have_osxaudio = cc.has_header('CoreAudio/CoreAudioTypes.h')
23endif
24
25if not have_osxaudio and osxaudio_option.enabled()
26  error('osxaudio plugin was enabled but CoreAudio headers not found')
27endif
28
29if have_osxaudio
30  modules = ['CoreAudio', 'AudioToolBox']
31  if host_system == 'darwin'
32    modules += ['AudioUnit', 'CoreServices']
33  endif
34  osxaudio_dep = dependency('appleframeworks', modules : modules)
35
36  gstosxaudio = library('gstosxaudio',
37    osxaudio_sources,
38    c_args : gst_plugins_good_args,
39    include_directories : [configinc, libsinc],
40    dependencies : [gstaudio_dep, osxaudio_dep],
41    install : true,
42    install_dir : plugins_install_dir)
43  pkgconfig.generate(gstosxaudio, install_dir : plugins_pkgconfig_install_dir)
44endif
45