meson: Add agent include dir to uninstalled pkgconfig file
[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   # Add agent include to uninstalled pkgconfig file
26   include_directories: agent_include,
27   version : libversion,
28   soversion : soversion,
29   vs_module_defs: libnice_def,
30   link_args: nice_link_args,
31   link_depends: mapfile,
32   install: true)
33
34 install_headers('nice.h', subdir: 'nice')
35 nice_include = include_directories('.')
36
37 # introspection
38 build_gir = gir.found() and not get_option('introspection').disabled()
39 if build_gir
40   nice_gen_sources += [
41     gnome.generate_gir(libnice,
42       sources : [agent_headers, agent_sources],
43       namespace : 'Nice',
44       nsversion : '0.1',
45       identifier_prefix : 'Nice',
46       symbol_prefix: 'nice',
47       export_packages: 'nice',
48       includes: ['GObject-2.0', 'Gio-2.0'],
49       extra_args: ['--accept-unprefixed'],
50       install: true)
51   ]
52 endif
53
54 libnice_dep = declare_dependency(link_with : libnice,
55   include_directories : [agent_include, nice_include],
56   # Everything that uses libnice needs this built to compile
57   sources : nice_gen_sources,
58   dependencies: nice_deps)
59
60 # pkg-config file
61 pkg = import('pkgconfig')
62 upnp_enabled_string = gupnp_igd_dep.found() ? 'true' : 'false'
63 pkg.generate(libnice,
64   name: 'libnice',
65   filebase: 'nice',
66   subdirs: 'nice',
67   description: 'ICE library',
68   libraries: gio_dep,
69   variables: ['upnp_enabled=@0@'.format(upnp_enabled_string)])