9c0cdd495248b6ac264006a39a33f386210c651c
[platform/upstream/libnice.git] / nice / meson.build
1 nice_gen_sources = []
2 nice_link_args = []
3
4 # libnice.def
5 libnice_def = custom_target('libnice.def',
6     command: [find_program('gen-def.py'), '@INPUT@'],
7     input: 'libnice.sym',
8     output: 'libnice.def',
9     capture: true)
10
11 # map file
12 mapfile = custom_target('libnice.map',
13     command: [find_program('gen-map.py'), '@INPUT@'],
14     input: 'libnice.sym',
15     output: 'libnice.map',
16     capture: true)
17 # We need to check with a file that exists at configure time!
18 if cc.has_link_argument('-Wl,--version-script,@0@/libnice.ver'.format(meson.current_source_dir()))
19   nice_link_args += ['-Wl,--version-script,@0@'.format(mapfile.full_path())]
20 endif
21
22 libnice = library('nice',
23   link_whole: [libagent, libsocket, libstun, librandom],
24   dependencies: nice_deps,
25   version : libversion,
26   soversion : soversion,
27   vs_module_defs: libnice_def,
28   link_args: nice_link_args,
29   link_depends: mapfile,
30   install: true)
31
32 install_headers('nice.h', subdir: 'nice')
33 nice_include = include_directories('.')
34
35 # introspection
36 build_gir = gir.found() and not get_option('introspection').disabled()
37 if build_gir
38   nice_gen_sources += [
39     gnome.generate_gir(libnice,
40       sources : [agent_headers, agent_sources],
41       namespace : 'Nice',
42       nsversion : '0.1',
43       identifier_prefix : 'Nice',
44       symbol_prefix: 'nice',
45       export_packages: 'nice',
46       includes: ['GObject-2.0', 'Gio-2.0'],
47       extra_args: ['--accept-unprefixed'],
48       install: true)
49   ]
50 endif
51
52 libnice_dep = declare_dependency(link_with : libnice,
53   include_directories : [agent_include, nice_include],
54   # Everything that uses libnice needs this built to compile
55   sources : nice_gen_sources,
56   dependencies: nice_deps)
57
58 # pkg-config file
59 pkg = import('pkgconfig')
60 upnp_enabled_string = gupnp_igd_dep.found() ? 'true' : 'false'
61 pkg.generate(libnice,
62   name: 'libnice',
63   filebase: 'nice',
64   subdirs: 'nice',
65   description: 'ICE library',
66   libraries: gio_dep,
67   variables: ['upnp_enabled=@0@'.format(upnp_enabled_string)])