From 2939585bd694eafbe7547beafccbbd38497a7678 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 5 Jan 2018 13:22:17 +0100 Subject: [PATCH] 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 --- glib/meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/glib/meson.build b/glib/meson.build index 6bd2ec94c..add29d06e 100644 --- a/glib/meson.build +++ b/glib/meson.build @@ -241,7 +241,11 @@ libglib = library('glib-2.0', 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 include_directories : [configinc, glibinc])