mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
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:
parent
5e5d030b1c
commit
fac80100c0
@ -72,7 +72,7 @@ libvirt_admin_syms = custom_target(
|
|||||||
'@OUTPUT@', 'LIBVIRT_ADMIN_PRIVATE_' + meson.project_version(), '@INPUT@',
|
'@OUTPUT@', 'LIBVIRT_ADMIN_PRIVATE_' + meson.project_version(), '@INPUT@',
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
libvirt_admin_syms_file = libvirt_admin_syms
|
|
||||||
if host_machine.system() == 'windows'
|
if host_machine.system() == 'windows'
|
||||||
libvirt_admin_def = custom_target(
|
libvirt_admin_def = custom_target(
|
||||||
'libvirt_admin.def',
|
'libvirt_admin.def',
|
||||||
@ -84,12 +84,22 @@ if host_machine.system() == 'windows'
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
libvirt_admin_syms_file = libvirt_admin_def
|
libvirt_admin_syms_file = libvirt_admin_def
|
||||||
|
libvirt_admin_syms_path = libvirt_admin_syms_file.full_path()
|
||||||
|
else
|
||||||
|
libvirt_admin_syms_file = libvirt_admin_syms
|
||||||
|
libvirt_admin_syms_path = libvirt_admin_syms_file.full_path()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
libvirt_admin_syms_flags = '@0@@1@'.format(
|
libvirt_admin_link_args = [
|
||||||
version_script_flags,
|
libvirt_nodelete,
|
||||||
libvirt_admin_syms_file.full_path(),
|
'@0@@1@'.format(
|
||||||
)
|
version_script_flags,
|
||||||
|
libvirt_admin_syms_path,
|
||||||
|
),
|
||||||
|
]
|
||||||
|
libvirt_admin_link_depends = [
|
||||||
|
libvirt_admin_syms_file,
|
||||||
|
]
|
||||||
|
|
||||||
if conf.has('WITH_REMOTE')
|
if conf.has('WITH_REMOTE')
|
||||||
admin_driver_lib = static_library(
|
admin_driver_lib = static_library(
|
||||||
|
104
src/meson.build
104
src/meson.build
@ -354,7 +354,7 @@ libvirt_syms = custom_target(
|
|||||||
'@OUTPUT@', 'LIBVIRT_PRIVATE_' + meson.project_version(), '@INPUT@',
|
'@OUTPUT@', 'LIBVIRT_PRIVATE_' + meson.project_version(), '@INPUT@',
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
libvirt_syms_file = libvirt_syms
|
|
||||||
if host_machine.system() == 'windows'
|
if host_machine.system() == 'windows'
|
||||||
libvirt_def = custom_target(
|
libvirt_def = custom_target(
|
||||||
'libvirt.def',
|
'libvirt.def',
|
||||||
@ -366,15 +366,27 @@ if host_machine.system() == 'windows'
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
libvirt_syms_file = libvirt_def
|
libvirt_syms_file = libvirt_def
|
||||||
|
libvirt_syms_path = libvirt_syms_file.full_path()
|
||||||
|
else
|
||||||
|
libvirt_syms_file = libvirt_syms
|
||||||
|
libvirt_syms_path = libvirt_syms_file.full_path()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
# libvirt.so library
|
# libvirt.so library
|
||||||
|
|
||||||
libvirt_syms_flags = '@0@@1@'.format(
|
libvirt_link_args = [
|
||||||
version_script_flags,
|
libvirt_flat_namespace,
|
||||||
libvirt_syms_file.full_path(),
|
libvirt_no_undefined,
|
||||||
)
|
libvirt_nodelete,
|
||||||
|
'@0@@1@'.format(
|
||||||
|
version_script_flags,
|
||||||
|
libvirt_syms_path,
|
||||||
|
),
|
||||||
|
]
|
||||||
|
libvirt_link_depends = [
|
||||||
|
libvirt_syms_file,
|
||||||
|
]
|
||||||
|
|
||||||
libvirt_lib = shared_library(
|
libvirt_lib = shared_library(
|
||||||
'virt',
|
'virt',
|
||||||
@ -382,18 +394,11 @@ libvirt_lib = shared_library(
|
|||||||
dependencies: [
|
dependencies: [
|
||||||
src_dep,
|
src_dep,
|
||||||
],
|
],
|
||||||
link_args: [
|
link_args: libvirt_link_args,
|
||||||
libvirt_flat_namespace,
|
|
||||||
libvirt_no_undefined,
|
|
||||||
libvirt_nodelete,
|
|
||||||
libvirt_syms_flags,
|
|
||||||
],
|
|
||||||
link_whole: [
|
link_whole: [
|
||||||
libvirt_libs,
|
libvirt_libs,
|
||||||
],
|
],
|
||||||
link_depends: [
|
link_depends: libvirt_link_depends,
|
||||||
libvirt_syms_file,
|
|
||||||
],
|
|
||||||
install: true,
|
install: true,
|
||||||
version: libvirt_lib_version,
|
version: libvirt_lib_version,
|
||||||
soversion: libvirt_so_version,
|
soversion: libvirt_so_version,
|
||||||
@ -403,8 +408,7 @@ libvirt_lib = shared_library(
|
|||||||
# libvirt-qemu.syms symbol files
|
# libvirt-qemu.syms symbol files
|
||||||
|
|
||||||
libvirt_qemu_syms = meson.current_source_dir() / 'libvirt_qemu.syms'
|
libvirt_qemu_syms = meson.current_source_dir() / 'libvirt_qemu.syms'
|
||||||
libvirt_qemu_syms_file = libvirt_qemu_syms
|
|
||||||
libvirt_qemu_syms_path = libvirt_qemu_syms
|
|
||||||
if host_machine.system() == 'windows'
|
if host_machine.system() == 'windows'
|
||||||
libvirt_qemu_def = custom_target(
|
libvirt_qemu_def = custom_target(
|
||||||
'libvirt_qemu.def',
|
'libvirt_qemu.def',
|
||||||
@ -416,16 +420,25 @@ if host_machine.system() == 'windows'
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
libvirt_qemu_syms_file = libvirt_qemu_def
|
libvirt_qemu_syms_file = libvirt_qemu_def
|
||||||
libvirt_qemu_syms_path = libvirt_qemu_def.full_path()
|
libvirt_qemu_syms_path = libvirt_qemu_syms_file.full_path()
|
||||||
|
else
|
||||||
|
libvirt_qemu_syms_file = libvirt_qemu_syms
|
||||||
|
libvirt_qemu_syms_path = libvirt_qemu_syms
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
# libvirt-qemu.so
|
# libvirt-qemu.so
|
||||||
|
|
||||||
libvirt_qemu_syms_flags = '@0@@1@'.format(
|
libvirt_qemu_link_args = [
|
||||||
version_script_flags,
|
libvirt_nodelete,
|
||||||
libvirt_qemu_syms_path,
|
'@0@@1@'.format(
|
||||||
)
|
version_script_flags,
|
||||||
|
libvirt_qemu_syms_path,
|
||||||
|
),
|
||||||
|
]
|
||||||
|
libvirt_qemu_link_depends = [
|
||||||
|
libvirt_qemu_syms_file,
|
||||||
|
]
|
||||||
|
|
||||||
libvirt_qemu_sources = files(
|
libvirt_qemu_sources = files(
|
||||||
'libvirt-qemu.c',
|
'libvirt-qemu.c',
|
||||||
@ -437,16 +450,11 @@ libvirt_qemu_lib = shared_library(
|
|||||||
dependencies: [
|
dependencies: [
|
||||||
src_dep,
|
src_dep,
|
||||||
],
|
],
|
||||||
link_args: [
|
link_args: libvirt_qemu_link_args,
|
||||||
libvirt_nodelete,
|
|
||||||
libvirt_qemu_syms_flags,
|
|
||||||
],
|
|
||||||
link_with: [
|
link_with: [
|
||||||
libvirt_lib,
|
libvirt_lib,
|
||||||
],
|
],
|
||||||
link_depends: [
|
link_depends: libvirt_qemu_link_depends,
|
||||||
libvirt_qemu_syms_file,
|
|
||||||
],
|
|
||||||
install: true,
|
install: true,
|
||||||
install_rpath: libvirt_rpath,
|
install_rpath: libvirt_rpath,
|
||||||
version: libvirt_lib_version,
|
version: libvirt_lib_version,
|
||||||
@ -457,8 +465,7 @@ libvirt_qemu_lib = shared_library(
|
|||||||
# libvirt-lxc.so symbol files
|
# libvirt-lxc.so symbol files
|
||||||
|
|
||||||
libvirt_lxc_syms = meson.current_source_dir() / 'libvirt_lxc.syms'
|
libvirt_lxc_syms = meson.current_source_dir() / 'libvirt_lxc.syms'
|
||||||
libvirt_lxc_syms_file = libvirt_lxc_syms
|
|
||||||
libvirt_lxc_syms_path = libvirt_lxc_syms
|
|
||||||
if host_machine.system() == 'windows'
|
if host_machine.system() == 'windows'
|
||||||
libvirt_lxc_def = custom_target(
|
libvirt_lxc_def = custom_target(
|
||||||
'libvirt_lxc.def',
|
'libvirt_lxc.def',
|
||||||
@ -470,16 +477,25 @@ if host_machine.system() == 'windows'
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
libvirt_lxc_syms_file = libvirt_lxc_def
|
libvirt_lxc_syms_file = libvirt_lxc_def
|
||||||
libvirt_lxc_syms_path = libvirt_lxc_def.full_path()
|
libvirt_lxc_syms_path = libvirt_lxc_syms_file.full_path()
|
||||||
|
else
|
||||||
|
libvirt_lxc_syms_file = libvirt_lxc_syms
|
||||||
|
libvirt_lxc_syms_path = libvirt_lxc_syms
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
# libvirt-lxc.so
|
# libvirt-lxc.so
|
||||||
|
|
||||||
libvirt_lxc_syms_flags = '@0@@1@'.format(
|
libvirt_lxc_link_args = [
|
||||||
version_script_flags,
|
libvirt_nodelete,
|
||||||
libvirt_lxc_syms_path,
|
'@0@@1@'.format(
|
||||||
)
|
version_script_flags,
|
||||||
|
libvirt_lxc_syms_path,
|
||||||
|
),
|
||||||
|
]
|
||||||
|
libvirt_lxc_link_depends = [
|
||||||
|
libvirt_lxc_syms_file,
|
||||||
|
]
|
||||||
|
|
||||||
libvirt_lxc_sources = files(
|
libvirt_lxc_sources = files(
|
||||||
'libvirt-lxc.c',
|
'libvirt-lxc.c',
|
||||||
@ -493,16 +509,11 @@ libvirt_lxc_lib = shared_library(
|
|||||||
selinux_dep,
|
selinux_dep,
|
||||||
src_dep,
|
src_dep,
|
||||||
],
|
],
|
||||||
link_args: [
|
link_args: libvirt_lxc_link_args,
|
||||||
libvirt_nodelete,
|
|
||||||
libvirt_lxc_syms_flags,
|
|
||||||
],
|
|
||||||
link_with: [
|
link_with: [
|
||||||
libvirt_lib,
|
libvirt_lib,
|
||||||
],
|
],
|
||||||
link_depends: [
|
link_depends: libvirt_lxc_link_depends,
|
||||||
libvirt_lxc_syms_file,
|
|
||||||
],
|
|
||||||
install: true,
|
install: true,
|
||||||
install_rpath: libvirt_rpath,
|
install_rpath: libvirt_rpath,
|
||||||
version: libvirt_lib_version,
|
version: libvirt_lib_version,
|
||||||
@ -537,16 +548,11 @@ if conf.has('WITH_REMOTE')
|
|||||||
admin_inc_dir,
|
admin_inc_dir,
|
||||||
remote_inc_dir,
|
remote_inc_dir,
|
||||||
],
|
],
|
||||||
link_args: [
|
link_args: libvirt_admin_link_args,
|
||||||
libvirt_admin_syms_flags,
|
|
||||||
libvirt_nodelete,
|
|
||||||
],
|
|
||||||
link_with: [
|
link_with: [
|
||||||
libvirt_lib,
|
libvirt_lib,
|
||||||
],
|
],
|
||||||
link_depends: [
|
link_depends: libvirt_admin_link_depends,
|
||||||
libvirt_admin_syms_file,
|
|
||||||
],
|
|
||||||
install: true,
|
install: true,
|
||||||
install_rpath: libvirt_rpath,
|
install_rpath: libvirt_rpath,
|
||||||
version: libvirt_lib_version,
|
version: libvirt_lib_version,
|
||||||
|
@ -49,25 +49,23 @@ nss_libvirt_guest_impl = static_library(
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
nss_libvirt_syms = '@0@@1@'.format(
|
nss_libvirt_syms_file = meson.current_source_dir() / nss_sym_file
|
||||||
version_script_flags,
|
nss_libvirt_syms_path = nss_libvirt_syms_file
|
||||||
meson.current_source_dir() / nss_sym_file,
|
|
||||||
)
|
|
||||||
|
|
||||||
nss_libvirt_guest_syms = '@0@@1@'.format(
|
nss_libvirt_link_args = [
|
||||||
version_script_flags,
|
libvirt_export_dynamic,
|
||||||
meson.current_source_dir() / nss_guest_sym_file,
|
coverage_flags,
|
||||||
)
|
'@0@@1@'.format(
|
||||||
|
version_script_flags,
|
||||||
|
nss_libvirt_syms_path,
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
||||||
nss_libvirt_lib = shared_library(
|
nss_libvirt_lib = shared_library(
|
||||||
'nss_libvirt',
|
'nss_libvirt',
|
||||||
name_prefix: nss_prefix,
|
name_prefix: nss_prefix,
|
||||||
name_suffix: 'so.@0@'.format(nss_so_ver),
|
name_suffix: 'so.@0@'.format(nss_so_ver),
|
||||||
link_args: [
|
link_args: nss_libvirt_link_args,
|
||||||
nss_libvirt_syms,
|
|
||||||
libvirt_export_dynamic,
|
|
||||||
coverage_flags,
|
|
||||||
],
|
|
||||||
link_whole: [
|
link_whole: [
|
||||||
nss_libvirt_impl,
|
nss_libvirt_impl,
|
||||||
],
|
],
|
||||||
@ -75,15 +73,23 @@ nss_libvirt_lib = shared_library(
|
|||||||
install_dir: libdir,
|
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_lib = shared_library(
|
||||||
'nss_libvirt_guest',
|
'nss_libvirt_guest',
|
||||||
name_prefix: nss_prefix,
|
name_prefix: nss_prefix,
|
||||||
name_suffix: 'so.@0@'.format(nss_so_ver),
|
name_suffix: 'so.@0@'.format(nss_so_ver),
|
||||||
link_args: [
|
link_args: nss_libvirt_guest_link_args,
|
||||||
nss_libvirt_guest_syms,
|
|
||||||
libvirt_export_dynamic,
|
|
||||||
coverage_flags,
|
|
||||||
],
|
|
||||||
link_whole: [
|
link_whole: [
|
||||||
nss_libvirt_guest_impl,
|
nss_libvirt_guest_impl,
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user