meson.build 3.75 KB
Newer Older
Wim Taymans's avatar
Wim Taymans committed
1
#project('spa', 'c')
Wim Taymans's avatar
Wim Taymans committed
2

3
4
5
6
#cc = meson.get_compiler('c')
#dl_lib = cc.find_library('dl', required : false)
#pthread_lib = dependencies('threads')
#mathlib = cc.find_library('m', required : false)
Wim Taymans's avatar
Wim Taymans committed
7

8
9
10
11
spa_dep = declare_dependency(
  include_directories : [
    include_directories('include'),
  ],
12
  dependencies : [atomic_dep],
13
  version : spaversion,
14
15
16
17
  variables : {
    'plugindir' : meson.current_build_dir() / 'plugins',
    'datadir' : meson.current_source_dir() / 'plugins',
  },
18
19
20
21
22
23
24
25
26
)

meson.override_dependency('lib@0@'.format(spa_name), spa_dep)

pkgconfig.generate(filebase : 'lib@0@'.format(spa_name),
  name : 'libspa',
  subdirs : spa_name,
  description : 'Simple Plugin API',
  version : spaversion,
columbarius's avatar
columbarius committed
27
  extra_cflags : '-D_REENTRANT',
28
29
30
  variables : ['plugindir=${libdir}/@0@'.format(spa_name)],
  uninstalled_variables : ['plugindir=${prefix}/spa/plugins'],
)
Wim Taymans's avatar
Wim Taymans committed
31
32

subdir('include')
33

34
if get_option('spa-plugins').allowed()
35
36
37
38
39
40
  udevrulesdir = get_option('udevrulesdir')
  if udevrulesdir == ''
    # absolute path, otherwise meson prepends the prefix
    udevrulesdir = '/lib/udev/rules.d'
  endif

41
  # plugin-specific dependencies
42
  alsa_dep = dependency('alsa', required: get_option('alsa'))
43
  summary({'ALSA': alsa_dep.found()}, bool_yn: true, section: 'Backend')
44
  bluez_dep = dependency('bluez', version : '>= 4.101', required: get_option('bluez5'))
45
  summary({'Bluetooth audio': bluez_dep.found()}, bool_yn: true, section: 'Backend')
46
47
  if bluez_dep.found()
    sbc_dep = dependency('sbc', required: get_option('bluez5'))
48
    summary({'SBC': sbc_dep.found()}, bool_yn: true, section: 'Bluetooth audio codecs')
49
    ldac_dep = dependency('ldacBT-enc', required : get_option('bluez5-codec-ldac'))
50
    summary({'LDAC': ldac_dep.found()}, bool_yn: true, section: 'Bluetooth audio codecs')
51
    ldac_abr_dep = dependency('ldacBT-abr', required : get_option('bluez5-codec-ldac'))
52
    summary({'LDAC ABR': ldac_abr_dep.found()}, bool_yn: true, section: 'Bluetooth audio codecs')
53
    aptx_dep = dependency('libfreeaptx', required : get_option('bluez5-codec-aptx'))
54
    summary({'aptX': aptx_dep.found()}, bool_yn: true, section: 'Bluetooth audio codecs')
55
    fdk_aac_dep = dependency('fdk-aac', required : get_option('bluez5-codec-aac'))
56
    summary({'AAC': fdk_aac_dep.found()}, bool_yn: true, section: 'Bluetooth audio codecs')
P V's avatar
P V committed
57
58
59
60
61
62
63
    lc3plus_dep = dependency('lc3plus', required : false)
    if not lc3plus_dep.found()
      lc3plus_lc3plus_h_dep = cc.find_library('LC3plus', has_headers: ['lc3plus.h'], required : get_option('bluez5-codec-lc3plus'))
      if lc3plus_lc3plus_h_dep.found()
        lc3plus_dep = declare_dependency(compile_args : '-DHAVE_LC3PLUS_H', dependencies : [ lc3plus_lc3plus_h_dep ])
      endif
    endif
P V's avatar
P V committed
64
    summary({'LC3plus': lc3plus_dep.found()}, bool_yn: true, section: 'Bluetooth audio codecs')
65
  endif
66
67
  avcodec_dep = dependency('libavcodec', required: get_option('ffmpeg'))
  jack_dep = dependency('jack', version : '>= 1.9.10', required: get_option('jack'))
68
  summary({'JACK2': jack_dep.found()}, bool_yn: true, section: 'Backend')
Ivan's avatar
Ivan committed
69
70
  vulkan_dep = dependency('vulkan', disabler : true, version : '>= 1.1.69', required: get_option('vulkan'))
  vulkan_headers = cc.has_header('vulkan/vulkan.h', dependencies : vulkan_dep)
71
  #summary({'Vulkan': vulkan_headers}, bool_yn: true, section: 'Misc dependencies')
72

73
  libcamera_dep = dependency('libcamera', required: get_option('libcamera'))
74
  summary({'libcamera': libcamera_dep.found()}, bool_yn: true, section: 'Backend')
75

Nils Tonnätt's avatar
Nils Tonnätt committed
76
  # common dependencies
Jonas Holmberg's avatar
Jonas Holmberg committed
77
  libudev_dep = dependency('libudev', required: alsa_dep.found() or get_option('udev').enabled() or get_option('v4l2').enabled())
78
  summary({'Udev': libudev_dep.found()}, bool_yn: true, section: 'Backend')
Nils Tonnätt's avatar
Nils Tonnätt committed
79

80
81
82
  subdir('plugins')
endif

Wim Taymans's avatar
Wim Taymans committed
83
84
subdir('tools')
subdir('tests')
85
if get_option('examples').allowed()
Fabrice Fontaine's avatar
Fabrice Fontaine committed
86
87
  subdir('examples')
endif