meson.build 3.33 KB
Newer Older
1
bluez5_deps = [ mathlib, dbus_dep, sbc_dep, bluez_dep ]
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
foreach dep: bluez5_deps
  if not dep.found()
    subdir_done()
  endif
endforeach

if not get_option('bluez5-backend-hsp-native').disabled()
  cdata.set('HAVE_BLUEZ_5_BACKEND_HSP_NATIVE', 1)
  cdata.set('HAVE_BLUEZ_5_BACKEND_NATIVE', 1)
endif
if not get_option('bluez5-backend-hfp-native').disabled()
  cdata.set('HAVE_BLUEZ_5_BACKEND_HFP_NATIVE', 1)
  cdata.set('HAVE_BLUEZ_5_BACKEND_NATIVE', 1)
endif
if not get_option('bluez5-backend-ofono').disabled()
  cdata.set('HAVE_BLUEZ_5_BACKEND_OFONO', 1)
endif
if not get_option('bluez5-backend-hsphfpd').disabled()
  cdata.set('HAVE_BLUEZ_5_BACKEND_HSPHFPD', 1)
endif
Wim Taymans's avatar
Wim Taymans committed
22

23
24
25
26
if dependency('bluez', version: '< 6', required: false).found()
  cdata.set('HAVE_BLUEZ_5_HCI', 1)
endif

27
28
29
30
31
32
33
34
35
36
bluez5_sources = [
  'plugin.c',
  'codec-loader.c',
  'a2dp-codecs.c',
  'a2dp-sink.c',
  'a2dp-source.c',
  'sco-sink.c',
  'sco-source.c',
  'sco-io.c',
  'quirks.c',
37
  'player.c',
38
  'bluez5-device.c',
39
40
  'bluez5-dbus.c',
  'hci.c'
41
]
42

43
44
45
46
bluez5_data = ['bluez-hardware.conf']

install_data(bluez5_data, install_dir : spa_datadir / 'bluez5')

47
if not get_option('bluez5-backend-hsp-native').disabled() or not get_option('bluez5-backend-hfp-native').disabled()
48
49
50
  if libusb_dep.found()
    bluez5_deps += libusb_dep
  endif
51
  bluez5_sources += ['backend-native.c']
52
53
endif

54
if not get_option('bluez5-backend-ofono').disabled()
55
56
  bluez5_sources += ['backend-ofono.c']
endif
Wim Taymans's avatar
Wim Taymans committed
57

58
if not get_option('bluez5-backend-hsphfpd').disabled()
59
60
61
  bluez5_sources += ['backend-hsphfpd.c']
endif

Wim Taymans's avatar
Wim Taymans committed
62
bluez5lib = shared_library('spa-bluez5',
63
  bluez5_sources,
64
65
  include_directories : [ configinc ],
  dependencies : [ spa_dep, bluez5_deps ],
66
67
  install : true,
  install_dir : spa_plugindir / 'bluez5')
68
69
70

codec_args = [ '-DCODEC_PLUGIN' ]

71
bluez_codec_sbc = shared_library('spa-codec-bluez5-sbc',
72
  [ 'a2dp-codec-sbc.c', 'a2dp-codecs.c' ],
73
  include_directories : [ configinc ],
74
  c_args : codec_args,
75
  dependencies : [ spa_dep, sbc_dep ],
76
77
  install : true,
  install_dir : spa_plugindir / 'bluez5')
78

79
bluez_codec_faststream = shared_library('spa-codec-bluez5-faststream',
80
  [ 'a2dp-codec-faststream.c', 'a2dp-codecs.c' ],
81
  include_directories : [ configinc ],
82
  c_args : codec_args,
83
  dependencies : [ spa_dep, sbc_dep ],
84
85
  install : true,
  install_dir : spa_plugindir / 'bluez5')
86
87

if fdk_aac_dep.found()
88
  bluez_codec_aac = shared_library('spa-codec-bluez5-aac',
89
    [ 'a2dp-codec-aac.c', 'a2dp-codecs.c' ],
90
    include_directories : [ configinc ],
91
    c_args : codec_args,
92
    dependencies : [ spa_dep, fdk_aac_dep ],
93
94
    install : true,
    install_dir : spa_plugindir / 'bluez5')
95
96
97
endif

if aptx_dep.found()
98
  bluez_codec_aptx = shared_library('spa-codec-bluez5-aptx',
99
    [ 'a2dp-codec-aptx.c', 'a2dp-codecs.c' ],
100
    include_directories : [ configinc ],
101
    c_args : codec_args,
102
    dependencies : [ spa_dep, aptx_dep, sbc_dep ],
103
104
    install : true,
    install_dir : spa_plugindir / 'bluez5')
105
106
107
108
109
110
111
112
113
endif

if ldac_dep.found()
  ldac_args = codec_args
  ldac_dep = [ ldac_dep ]
  if ldac_abr_dep.found()
    ldac_args += [ '-DENABLE_LDAC_ABR' ]
    ldac_dep += ldac_abr_dep
  endif
114
  bluez_codec_ldac = shared_library('spa-codec-bluez5-ldac',
115
    [ 'a2dp-codec-ldac.c', 'a2dp-codecs.c' ],
116
    include_directories : [ configinc ],
117
    c_args : ldac_args,
118
    dependencies : [ spa_dep, ldac_dep ],
119
120
    install : true,
    install_dir : spa_plugindir / 'bluez5')
121
endif