summaryrefslogtreecommitdiff
path: root/sys/wasapi/meson.build
blob: 9adc3d6902e3fde4f414e988018de658244839be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
wasapi_sources = [
  'gstwasapi.c',
  'gstwasapisrc.c',
  'gstwasapisink.c',
  'gstwasapiutil.c',
  'gstwasapidevice.c',
]

if host_system != 'windows'
  if get_option('wasapi').disabled()
    subdir_done()
  elif get_option('wasapi').enabled()
    error('Cannot build wasapi plugin when not building for Windows')
  endif
endif

ole32_dep = cc.find_library('ole32', required : get_option('wasapi'))
ksuser_dep = cc.find_library('ksuser', required : get_option('wasapi'))
have_audioclient_h = cc.has_header('audioclient.h')
if not have_audioclient_h and get_option('wasapi').enabled()
  error('wasapi plugin enabled but audioclient.h not found')
endif

if ole32_dep.found() and ksuser_dep.found() and have_audioclient_h
  wasapi_args = ['-DCOBJMACROS']
  if cc.has_header_symbol('audioclient.h', 'AUDCLNT_STREAMOPTIONS_NONE')
    wasapi_args += ['-DHAVE_AUDCLNT_STREAMOPTIONS']
  endif

  gstwasapi = library('gstwasapi',
    wasapi_sources,
    c_args : gst_plugins_bad_args + wasapi_args,
    include_directories : [configinc],
    dependencies : [gstaudio_dep, ole32_dep, ksuser_dep],
    install : true,
    install_dir : plugins_install_dir)
  pkgconfig.generate(gstwasapi, install_dir : plugins_pkgconfig_install_dir)
  plugins += [gstwasapi]
endif