summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2020-12-15 12:03:19 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2021-01-02 21:03:36 +0100
commit953d5a9ef326da80b2abc37f73c6e8525c3da033 (patch)
tree6767ba250684563ca84aba53e1f768f1c281b1d6
parenta111824382dad27db8c358b2b9b26cdf30eaf49f (diff)
downloadfocaccia-qemu-953d5a9ef326da80b2abc37f73c6e8525c3da033.tar.gz
focaccia-qemu-953d5a9ef326da80b2abc37f73c6e8525c3da033.zip
build-sys: fix -static linking of libvhost-user
Fix linking vhost-user binaries with with ./configure -static, by
overriding glib-2.0 dependency with configure results.

Fixes: 0df750e9d3a5fea5e1 ("libvhost-user: make it a meson subproject")
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20201215080319.136228-1-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--meson.build6
1 files changed, 5 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 94ef023ad1..ada35d56e1 100644
--- a/meson.build
+++ b/meson.build
@@ -268,7 +268,11 @@ endif
 # grandfathered in from the QEMU Makefiles.
 add_project_arguments(config_host['GLIB_CFLAGS'].split(),
                       native: false, language: ['c', 'cpp', 'objc'])
-glib = declare_dependency(link_args: config_host['GLIB_LIBS'].split())
+glib = declare_dependency(compile_args: config_host['GLIB_CFLAGS'].split(),
+                          link_args: config_host['GLIB_LIBS'].split())
+# override glib dep with the configure results (for subprojects)
+meson.override_dependency('glib-2.0', glib)
+
 gio = not_found
 if 'CONFIG_GIO' in config_host
   gio = declare_dependency(compile_args: config_host['GIO_CFLAGS'].split(),