build: Ensure that gcov symbols are exposed when needed

When coverage is enabled, we need to expose the __gcov_* symbols in the
binaries and libraries or we won't get any coverage report for them.
This commit is contained in:
Marco Trevisan (Treviño)
2020-02-05 13:54:44 +01:00
committed by Bastien Nocera
parent 73625233f6
commit 526b2e8c53
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,7 @@
{
global:
pam_*;
__gcov_*;
local:
*;
};

View File

@ -53,6 +53,8 @@ fprintd_deps = declare_dependency(
],
)
symbol_visibility = get_option('b_coverage') ? 'default' : 'hidden'
libfprintd_private = static_library('fprintd-private',
sources: [
'device.c',
@ -62,7 +64,7 @@ libfprintd_private = static_library('fprintd-private',
fprintd_marshal,
],
dependencies: fprintd_deps,
gnu_symbol_visibility: 'hidden',
gnu_symbol_visibility: symbol_visibility,
)
fprintd = executable('fprintd',
@ -75,7 +77,7 @@ fprintd = executable('fprintd',
],
dependencies: fprintd_deps,
link_with: libfprintd_private,
gnu_symbol_visibility: 'hidden',
gnu_symbol_visibility: symbol_visibility,
install: true,
install_dir: fprintd_installdir,
)