meson: Fix build with -Dtest_coverage=true

As can be seen in commit 8a62a1592a (from
autoconf era), the coverage flags have to be used also when linking
objects. However, this was not reflected when we switched to meson.

Without this patch linking fails with undefined references to various
__gcov_* symbols.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Jiri Denemark 2021-01-15 22:35:09 +01:00
parent 85523cfae0
commit 36b47ffed9
3 changed files with 9 additions and 4 deletions

View File

@ -26,7 +26,10 @@ tests_dep = declare_dependency(
top_inc_dir,
util_inc_dir,
],
link_args: libvirt_export_dynamic,
link_args: (
libvirt_export_dynamic
+ coverage_flags
),
)
tests_env = [
@ -228,9 +231,6 @@ executable(
dependencies: [
tests_dep,
],
link_args: [
coverage_flags,
],
)

View File

@ -66,6 +66,7 @@ nss_libvirt_lib = shared_module(
link_args: [
nss_libvirt_syms,
libvirt_export_dynamic,
coverage_flags,
],
link_whole: [
nss_libvirt_impl,
@ -81,6 +82,7 @@ nss_libvirt_guest_lib = shared_library(
link_args: [
nss_libvirt_guest_syms,
libvirt_export_dynamic,
coverage_flags,
],
link_whole: [
nss_libvirt_guest_impl,

View File

@ -12,6 +12,9 @@ shared_library(
xdr_dep,
tools_dep,
],
link_args: [
coverage_flags
],
install: true,
install_dir: wireshark_plugindir,
)