summaryrefslogtreecommitdiff
path: root/sys/shm/meson.build
blob: 7618a6778076455d425848b23b72a823da1ce885 (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
40
41
42
43
44
shm_sources = [
  'shmpipe.c',
  'shmalloc.c',
  'gstshm.c',
  'gstshmsrc.c',
  'gstshmsink.c',
]

shm_deps = []
shm_enabled = false
if get_option('shm').disabled()
  subdir_done()
endif

if ['darwin', 'ios'].contains(host_system) or host_system.endswith('bsd')
  rt_dep = []
  shm_enabled = true
else
  rt_dep = cc.find_library ('rt', required: false)
  shm_enabled = rt_dep.found()
endif

if shm_enabled
  shm_enabled = cc.has_header('sys/socket.h')
elif get_option('shm').enabled()
  error('shm plugin enabled but librt not found')
endif

if not shm_enabled and get_option('shm').enabled()
  error('shm plugin enabled but socket.h not found')
endif

if shm_enabled
  gstshm = library('gstshm',
    shm_sources,
    c_args : gst_plugins_bad_args + ['-DSHM_PIPE_USE_GLIB'],
    include_directories : [configinc],
    dependencies : [gstbase_dep, rt_dep],
    install : true,
    install_dir : plugins_install_dir,
  )
  pkgconfig.generate(gstshm, install_dir : plugins_pkgconfig_install_dir)
  plugins += [gstshm]
endif