summaryrefslogtreecommitdiff
path: root/nice
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2017-07-30 16:42:52 +0100
committerOlivier Crête <olivier.crete@collabora.com>2018-12-14 14:47:01 -0500
commit0e0f89d2b916dc0475787e0970bb692882ee3de2 (patch)
treee63653836a4e07fd0d54c5b2b5b52d7535d37c91 /nice
parented70ea09b6b283b25d3047443c00a14c8cb29e1a (diff)
downloadlibnice-0e0f89d2b916dc0475787e0970bb692882ee3de2.tar.gz
Add support for Meson build system
Diffstat (limited to 'nice')
-rw-r--r--nice/gen-def.py19
-rw-r--r--nice/gen-map.py28
-rw-r--r--nice/libnice.sym1
-rw-r--r--nice/meson.build66
4 files changed, 114 insertions, 0 deletions
diff --git a/nice/gen-def.py b/nice/gen-def.py
new file mode 100644
index 0000000..fb6116c
--- /dev/null
+++ b/nice/gen-def.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python3
+#
+# gen-def.py LIBNICE.SYM
+import os
+import sys
+
+try:
+ sym_file = sys.argv[1]
+except:
+ print('Usage: gen-def.py SYM-FILE')
+ exit(-1)
+
+f = open(os.path.join(sym_file), 'r')
+
+print('EXPORTS')
+for line in f:
+ print(' ' + line.strip())
+
+f.close()
diff --git a/nice/gen-map.py b/nice/gen-map.py
new file mode 100644
index 0000000..e1e49c0
--- /dev/null
+++ b/nice/gen-map.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python3
+#
+# gen-map.py LIBNICE.SYM
+import os
+import sys
+
+try:
+ sym_file = sys.argv[1]
+except:
+ print('Usage: gen-map.py SYM-FILE')
+ exit(-1)
+
+f = open(os.path.join(sym_file), 'r')
+
+print('''libnice {
+global:''')
+
+for line in f:
+ print('\t' + line.strip() + ';')
+
+print('''};
+
+HIDDEN {
+local:
+ *;
+};''')
+
+f.close()
diff --git a/nice/libnice.sym b/nice/libnice.sym
index 1e522ad..e7c4019 100644
--- a/nice/libnice.sym
+++ b/nice/libnice.sym
@@ -60,6 +60,7 @@ nice_agent_set_stream_tos
nice_candidate_copy
nice_candidate_equal_target
nice_candidate_free
+nice_candidate_get_type
nice_candidate_new
nice_component_state_to_string
nice_debug_disable
diff --git a/nice/meson.build b/nice/meson.build
new file mode 100644
index 0000000..dbb0e89
--- /dev/null
+++ b/nice/meson.build
@@ -0,0 +1,66 @@
+nice_gen_sources = []
+nice_link_args = []
+
+# libnice.def
+libnice_def = custom_target('libnice.def',
+ command: [find_program('gen-def.py'), '@INPUT@'],
+ input: 'libnice.sym',
+ output: 'libnice.def',
+ capture: true)
+
+# map file
+mapfile = custom_target('libnice.map',
+ command: [find_program('gen-map.py'), '@INPUT@'],
+ input: 'libnice.sym',
+ output: 'libnice.map',
+ capture: true)
+# We need to check with a file that exists at configure time!
+if cc.has_link_argument('-Wl,--version-script,@0@/libnice.ver'.format(meson.current_source_dir()))
+ nice_link_args += ['-Wl,--version-script,@0@'.format(mapfile.full_path())]
+endif
+
+libnice = library('nice',
+ link_whole: [libagent, libsocket, libstun, librandom],
+ version : libversion,
+ soversion : soversion,
+ vs_module_defs: libnice_def,
+ link_args: nice_link_args,
+ link_depends: mapfile,
+ install: true)
+
+install_headers('nice.h', subdir: 'nice')
+nice_include = include_directories('.')
+
+# introspection
+build_gir = not get_option('introspection').disabled() and get_option('default_library') != 'static'
+if build_gir
+ nice_gen_sources += [
+ gnome.generate_gir(libnice,
+ sources : [agent_headers, agent_sources],
+ namespace : 'Nice',
+ nsversion : '0.1',
+ identifier_prefix : 'Nice',
+ symbol_prefix: 'nice',
+ export_packages: 'nice',
+ includes: ['GObject-2.0', 'Gio-2.0'],
+ extra_args: ['--accept-unprefixed'],
+ install: true)
+ ]
+endif
+
+libnice_dep = declare_dependency(link_with : libnice,
+ include_directories : [agent_include, nice_include],
+ # Everything that uses libnice needs this built to compile
+ sources : nice_gen_sources)
+
+# pkg-config file
+pkg = import('pkgconfig')
+upnp_enabled_string = gupnp_igd_dep.found() ? 'true' : 'false'
+pkg.generate(libnice,
+ name: 'libnice',
+ filebase: 'nice',
+ subdirs: 'nice',
+ description: 'ICE library',
+ requires: glib_dep,
+ requires_private: [gthread_dep, gupnp_igd_dep, gnutls_dep, syslibs],
+ variables: ['upnp_enabled=@0@'.format(upnp_enabled_string)])