1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-07 21:17:55 +03:00

meson: src: add code to build shared modules

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-06-25 15:42:06 +02:00
parent 4e07c26c59
commit 88f3137cae
2 changed files with 47 additions and 8 deletions

View File

@ -19,12 +19,6 @@
# No libraries with the exception of LIBXML should be listed
# here. List them against the individual XXX_la_CFLAGS targets
# that actually use them.
AM_LDFLAGS_MOD = \
-module \
-avoid-version \
$(LIBVIRT_NODELETE) \
$(AM_LDFLAGS)
AM_LDFLAGS_MOD_NOUNDEF = $(AM_LDFLAGS_MOD) $(NO_UNDEFINED_LDFLAGS)
BUILT_SOURCES =
nodist_conf_DATA =
@ -82,8 +76,6 @@ include storage/Makefile.inc.am
include remote/Makefile.inc.am
moddir = $(libdir)/libvirt/connection-driver
confdir = $(sysconfdir)/libvirt
conf_DATA += libvirt.conf

View File

@ -127,6 +127,19 @@ endif
libvirt_libs = []
# virt_modules:
# each entry is a dictionary with following items:
# * name - module name (required)
# * sources - module sources (optional, default [])
# * name_prefix - resulting library prefix (optional, default 'lib')
# * include - include_directories (optional, default [])
# * deps - dependencies (optional, default [])
# * link_with - static libraries to link with (optional, default [])
# * link_whole - static libraries to include (optional, default [])
# * link_args - arguments for linker (optional, default [])
# * install_dir - installation directory (optional, default libdir / 'libvirt' / 'connection-driver'
virt_modules = []
# list subdirectories
@ -427,3 +440,37 @@ libvirt_admin_lib = shared_library(
version: libvirt_lib_version,
soversion: libvirt_so_version,
)
# build libvirt shared modules
foreach module : virt_modules
mod = shared_module(
module['name'],
module.get('sources', []),
name_prefix: module.get('name_prefix', 'lib'),
include_directories: [
conf_inc_dir,
module.get('include', []),
],
dependencies: [
src_dep,
module.get('deps', []),
],
link_with: [
libvirt_lib,
module.get('link_with', []),
],
link_whole: [
module.get('link_whole', []),
],
link_args: [
libvirt_nodelete,
module.get('link_args', []),
],
install: true,
install_dir: module.get('install_dir', libdir / 'libvirt' / 'connection-driver'),
install_rpath: libdir,
)
set_variable('@0@_module'.format(module['name'].underscorify()), mod)
endforeach