meson: Refactor handling of link_args and link_depends

This ensures variable names and the overall structure of the
code setting and using them is consistent. It will also make
upcoming changes less disruptive.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Andrea Bolognani
2022-05-05 15:06:47 +02:00
parent 5e5d030b1c
commit fac80100c0
3 changed files with 94 additions and 72 deletions

View File

@@ -49,25 +49,23 @@ nss_libvirt_guest_impl = static_library(
],
)
nss_libvirt_syms = '@0@@1@'.format(
version_script_flags,
meson.current_source_dir() / nss_sym_file,
)
nss_libvirt_syms_file = meson.current_source_dir() / nss_sym_file
nss_libvirt_syms_path = nss_libvirt_syms_file
nss_libvirt_guest_syms = '@0@@1@'.format(
version_script_flags,
meson.current_source_dir() / nss_guest_sym_file,
)
nss_libvirt_link_args = [
libvirt_export_dynamic,
coverage_flags,
'@0@@1@'.format(
version_script_flags,
nss_libvirt_syms_path,
),
]
nss_libvirt_lib = shared_library(
'nss_libvirt',
name_prefix: nss_prefix,
name_suffix: 'so.@0@'.format(nss_so_ver),
link_args: [
nss_libvirt_syms,
libvirt_export_dynamic,
coverage_flags,
],
link_args: nss_libvirt_link_args,
link_whole: [
nss_libvirt_impl,
],
@@ -75,15 +73,23 @@ nss_libvirt_lib = shared_library(
install_dir: libdir,
)
nss_libvirt_guest_syms_file = meson.current_source_dir() / nss_guest_sym_file
nss_libvirt_guest_syms_path = nss_libvirt_guest_syms_file
nss_libvirt_guest_link_args = [
libvirt_export_dynamic,
coverage_flags,
'@0@@1@'.format(
version_script_flags,
nss_libvirt_guest_syms_path,
),
]
nss_libvirt_guest_lib = shared_library(
'nss_libvirt_guest',
name_prefix: nss_prefix,
name_suffix: 'so.@0@'.format(nss_so_ver),
link_args: [
nss_libvirt_guest_syms,
libvirt_export_dynamic,
coverage_flags,
],
link_args: nss_libvirt_guest_link_args,
link_whole: [
nss_libvirt_guest_impl,
],