summaryrefslogtreecommitdiff
path: root/src/admin/meson.build
blob: e04d610f924c2853efdf68e8f1f735f7f961a4c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
admin_driver_sources = [
  'admin_server.c',
  'admin_server_dispatch.c',
]

admin_driver_protocol = files('admin_protocol.x')

rpc_probe_files += admin_driver_protocol

admin_driver_generated = []

admin_protocol_h = custom_target(
  'admin_protocol.h',
  input: admin_driver_protocol,
  output: 'admin_protocol.h',
  command: [
    genprotocol_prog, rpcgen_prog, '-h', '@INPUT@', '@OUTPUT@',
  ],
)
admin_driver_generated += admin_protocol_h

admin_driver_generated += custom_target(
  'admin_protocol.c',
  input: admin_driver_protocol,
  output: 'admin_protocol.c',
  command: [
    genprotocol_prog, rpcgen_prog, '-c', '@INPUT@', '@OUTPUT@',
  ],
)

admin_driver_generated += custom_target(
  'admin_server_dispatch_stubs.h',
  input: admin_driver_protocol,
  output: 'admin_server_dispatch_stubs.h',
  command: [
    gendispatch_prog, '--mode=server', 'admin', 'ADMIN', '@INPUT@',
  ],
  capture: true,
)

admin_sources = files(
  'libvirt-admin.c',
)

admin_client_generated = custom_target(
  'admin_client.h',
  input: admin_driver_protocol,
  output: 'admin_client.h',
  command: [
    gendispatch_prog, '--mode=client', 'admin', 'ADMIN', '@INPUT@',
  ],
  capture: true,
)

libvirt_admin_public_syms = files(
  'libvirt_admin_public.syms',
)

libvirt_admin_private_syms = files(
  'libvirt_admin_private.syms',
)

libvirt_admin_syms = custom_target(
  'libvirt_admin.syms',
  input: [
    libvirt_admin_public_syms,
    libvirt_admin_private_syms,
  ],
  output: 'libvirt_admin.syms',
  command: [
    meson_gen_sym_prog,
    '@OUTPUT@', 'LIBVIRT_ADMIN_PRIVATE_' + meson.project_version(), '@INPUT@',
  ],
)

if host_machine.system() == 'windows'
  libvirt_admin_def = custom_target(
    'libvirt_admin.def',
    input: libvirt_admin_syms,
    output: 'libvirt_admin.def',
    command: [
      meson_gen_def_prog,
      '@INPUT@', '@OUTPUT@',
    ],
  )
  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

libvirt_admin_link_args = [
  libvirt_nodelete,
]
libvirt_admin_link_depends = []

if version_script_flags != ''
  libvirt_admin_link_args += '@0@@1@'.format(
    version_script_flags,
    libvirt_admin_syms_path,
  )
  libvirt_admin_link_depends += libvirt_admin_syms_file
endif

if conf.has('WITH_REMOTE')
  admin_driver_lib = static_library(
    'virt_admin_driver',
    [
      admin_driver_sources,
      admin_driver_generated,
    ],
    dependencies: [
      rpc_dep,
      sasl_dep,
      src_dep,
      xdr_dep,
    ],
  )

  check_protocols += {
    'name': 'admin_protocol',
    'lib': admin_driver_lib,
  }
endif

virt_conf_files += files('libvirt-admin.conf')

admin_inc_dir = include_directories('.')

admin_dep = declare_dependency(
  include_directories: admin_inc_dir,
  sources: [ admin_protocol_h ],
)