summaryrefslogtreecommitdiff
path: root/sys/decklink/meson.build
blob: 2b795c4c6d9273d1d6aa7eaadcea06946df8042e (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
decklink_sources = [
  'gstdecklink.cpp',
  'gstdecklinkaudiosink.cpp',
  'gstdecklinkvideosink.cpp',
  'gstdecklinkaudiosrc.cpp',
  'gstdecklinkvideosrc.cpp',
]

build_decklink = false
decklink_ldflags = []
decklink_cppargs = []
libdl = cc.find_library('dl', required: false)
have_pthread_h = cdata.has('HAVE_PTHREAD_H')

if libdl.found() and have_pthread_h
  if host_machine.system() == 'linux'
    decklink_sources += ['linux/DeckLinkAPIDispatch.cpp']
    build_decklink = true
  elif host_machine.system() == 'darwin'
    decklink_sources += ['osx/DeckLinkAPIDispatch.cpp']
    decklink_ldflags = '-Wl,-framework,CoreFoundation'
    build_decklink = true
  else
    message('Not building decklink plugin for system ' + host_machine.system())
  endif
endif

cxx = meson.get_compiler('cpp')
if cxx.has_argument('-Wno-non-virtual-dtor')
  decklink_cppargs += ['-Wno-non-virtual-dtor']
endif

if build_decklink
  decklink = library('gstdecklink',
    decklink_sources,
    cpp_args : gst_plugins_bad_args + decklink_cppargs,
    link_args : decklink_ldflags + noseh_link_args,
    include_directories : [configinc],
    dependencies : [gstvideo_dep, gstaudio_dep, gstbase_dep, gst_dep, libm, libdl, dependency('threads')],
    install : true,
    install_dir : plugins_install_dir,
  )
endif