Commit 17272759 authored by Jakub Adam's avatar Jakub Adam Committed by Olivier Crête

meson: Fix build with fallback glib

When building libnice with glib fallback, its 'libgio_dep' internal
dependency doesn't provide all needed include and library search paths.

To avoid unresolved header files and linker errors in such case,
'libglib_dep', 'libmodule_dep' and 'libgobject_dep' from glib submodule
must be pulled in as well.

The problem should be fixed in GLib 2.60.
parent 9864f36b
......@@ -3,6 +3,6 @@ examples = ['simple-example', 'threaded-example', 'sdp-example']
foreach ex : examples
executable(ex, '@0@.c'.format(ex),
include_directories: nice_incs,
dependencies: [libnice_dep, glib_dep, gupnp_igd_dep],
dependencies: gio_deps + [libnice_dep, gupnp_igd_dep],
install: false)
......@@ -163,8 +163,18 @@ foreach w : warnings
# Dependencies
glib_dep = dependency('gio-2.0', version: glib_req,
gio_dep = dependency('gio-2.0', version: glib_req,
fallback: ['glib', 'libgio_dep'])
gio_deps = [gio_dep]
if gio_dep.type_name() == 'internal'
# A workaround for libgio_dep not having its dependencies correctly declared.
# Should be fixed in GLib 2.60.
gio_deps += [
dependency('', fallback: ['glib', 'libglib_dep']),
dependency('', fallback: ['glib', 'libgmodule_dep']),
dependency('', fallback: ['glib', 'libgobject_dep'])
gthread_dep = dependency('gthread-2.0',
fallback: ['glib', 'libgthread_dep'])
......@@ -212,7 +222,7 @@ libm = cc.find_library('m', required: false)
nice_incs = include_directories('.', 'agent', 'random', 'socket', 'stun')
nice_deps = [glib_dep, gthread_dep, crypto_dep, gupnp_igd_dep] + syslibs
nice_deps = gio_deps + [gthread_dep, crypto_dep, gupnp_igd_dep] + syslibs
ignored_iface_prefix = get_option('ignored-network-interface-prefix')
if ignored_iface_prefix != ''
......@@ -62,7 +62,7 @@ pkg.generate(libnice,
filebase: 'nice',
subdirs: 'nice',
description: 'ICE library',
requires: glib_dep,
requires: gio_dep,
requires_private: [gthread_dep, gupnp_igd_dep, crypto_dep],
libraries_private: syslibs,
variables: ['upnp_enabled=@0@'.format(upnp_enabled_string)])
......@@ -2,13 +2,13 @@ librandom = static_library('nice-random',
'random.c', 'random-glib.c',
c_args: ['-DG_LOG_DOMAIN="libnice-random"'],
include_directories: nice_incs,
dependencies: [glib_dep, gthread_dep],
dependencies: gio_deps + [gthread_dep],
install: false)
if not get_option('tests').disabled()
test_exe = executable('nice-random-test', 'test.c',
include_directories: nice_incs,
dependencies: [glib_dep, gthread_dep],
dependencies: gio_deps + [gthread_dep],
link_with: librandom)
test('nice-random', test_exe)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment