0a296869adf0fe8978f5e7d5ff96a0793721ee79
[platform/upstream/gstreamer.git] / ext / srtp / meson.build
1 srtp_sources = [
2   'gstsrtp.c',
3   'gstsrtpdec.c',
4   'gstsrtpenc.c',
5 ]
6
7 srtp_cargs = []
8 if get_option('srtp').disabled()
9   subdir_done()
10 endif
11
12 srtp_dep = dependency('libsrtp2', version : '>= 2.1.0', required : false)
13 if srtp_dep.found()
14   srtp_cargs += ['-DHAVE_SRTP2']
15 else
16   srtp_dep = dependency('libsrtp', required : false)
17   if not srtp_dep.found() and cc.has_header_symbol('srtp/srtp.h', 'srtp_init')
18     srtp_dep = cc.find_library('srtp', required : false)
19   endif
20 endif
21 if not srtp_dep.found() and get_option('srtp').enabled()
22   error('srtp plugin enabled but libsrtp not found')
23 endif
24
25 if srtp_dep.found()
26   gstsrtp_enums = gnome.mkenums_simple('gstsrtp-enumtypes',
27     sources : ['gstsrtpenums.h'],
28     decorator : 'G_GNUC_INTERNAL',
29     install_header: false)
30
31   gstsrtp = library('gstsrtp',
32     srtp_sources, gstsrtp_enums,
33     c_args : gst_plugins_bad_args + srtp_cargs,
34     link_args : noseh_link_args,
35     include_directories : [configinc],
36     dependencies : [gstrtp_dep, gstvideo_dep, srtp_dep],
37     install : true,
38     install_dir : plugins_install_dir,
39   )
40   pkgconfig.generate(gstsrtp, install_dir : plugins_pkgconfig_install_dir)
41 endif