meson: work around meson not passing on the threads dependency when link_with is used

When using link_with with declare_dependency() or executable() the threads
dependency is not passed on. To work around the issue add the threads dependency
manually. See https://github.com/mesonbuild/meson/issues/1426

This makes the static build on Linux work.

https://bugzilla.gnome.org/show_bug.cgi?id=788806
This commit is contained in:
Christoph Reiter 2018-01-05 13:22:17 +01:00
parent 6d009bc56a
commit 2939585bd6

View File

@ -241,7 +241,11 @@ libglib = library('glib-2.0',
c_args : ['-DG_LOG_DOMAIN="GLib"', '-DGLIB_COMPILATION'] + pcre_static_args + glib_hidden_visibility_args c_args : ['-DG_LOG_DOMAIN="GLib"', '-DGLIB_COMPILATION'] + pcre_static_args + glib_hidden_visibility_args
) )
libglib_dep = declare_dependency(link_with : libglib, libglib_dep = declare_dependency(
link_with : libglib,
# thread_dep doesn't get pulled in from libglib atm,
# see https://github.com/mesonbuild/meson/issues/1426
dependencies : [thread_dep],
# We sadly need to export configinc here because everyone includes <glib/*.h> # We sadly need to export configinc here because everyone includes <glib/*.h>
include_directories : [configinc, glibinc]) include_directories : [configinc, glibinc])