]> git.proxmox.com Git - mirror_qemu.git/blame - block/meson.build
Merge tag 'pull-block-2023-09-01' of https://gitlab.com/hreitz/qemu into staging
[mirror_qemu.git] / block / meson.build
CommitLineData
5e5733e5
MAL
1block_ss.add(genh)
2block_ss.add(files(
3 'accounting.c',
4 'aio_task.c',
5 'amend.c',
6 'backup.c',
5e5733e5
MAL
7 'blkdebug.c',
8 'blklogwrites.c',
5e5733e5
MAL
9 'blkverify.c',
10 'block-backend.c',
11 'block-copy.c',
12 'commit.c',
9e03a5e1 13 'copy-before-write.c',
5e5733e5
MAL
14 'copy-on-read.c',
15 'create.c',
16 'crypto.c',
17 'dirty-bitmap.c',
18 'filter-compress.c',
9e03a5e1 19 'graph-lock.c',
5e5733e5
MAL
20 'io.c',
21 'mirror.c',
22 'nbd.c',
23 'null.c',
41abca8c 24 'plug.c',
9e03a5e1
KW
25 'preallocate.c',
26 'progress_meter.c',
5e5733e5 27 'qapi.c',
9e03a5e1 28 'qcow2.c',
5e5733e5
MAL
29 'qcow2-bitmap.c',
30 'qcow2-cache.c',
31 'qcow2-cluster.c',
32 'qcow2-refcount.c',
33 'qcow2-snapshot.c',
34 'qcow2-threads.c',
5e5733e5
MAL
35 'quorum.c',
36 'raw-format.c',
d088e6a4 37 'reqlist.c',
5e5733e5 38 'snapshot.c',
1c14eaab 39 'snapshot-access.c',
5e5733e5 40 'throttle.c',
9e03a5e1 41 'throttle-groups.c',
5e5733e5 42 'write-threshold.c',
3eacf70b 43), zstd, zlib, gnutls)
5e5733e5 44
de6cd759
PMD
45system_ss.add(when: 'CONFIG_TCG', if_true: files('blkreplay.c'))
46system_ss.add(files('block-ram-registrar.c'))
9b1c9116 47
ed793c2c
PB
48if get_option('qcow1').allowed()
49 block_ss.add(files('qcow.c'))
50endif
51if get_option('vdi').allowed()
52 block_ss.add(files('vdi.c'))
53endif
11cea42e
VSO
54if get_option('vhdx').allowed()
55 block_ss.add(files(
56 'vhdx-endian.c',
57 'vhdx-log.c',
58 'vhdx.c'
59 ))
60endif
61if get_option('vmdk').allowed()
62 block_ss.add(files('vmdk.c'))
63endif
64if get_option('vpc').allowed()
65 block_ss.add(files('vpc.c'))
66endif
ed793c2c
PB
67if get_option('cloop').allowed()
68 block_ss.add(files('cloop.c'))
69endif
70if get_option('bochs').allowed()
71 block_ss.add(files('bochs.c'))
72endif
73if get_option('vvfat').allowed()
74 block_ss.add(files('vvfat.c'))
75endif
76if get_option('dmg').allowed()
77 block_ss.add(files('dmg.c'))
78endif
79if get_option('qed').allowed()
80 block_ss.add(files(
81 'qed-check.c',
82 'qed-cluster.c',
83 'qed-l2-cache.c',
84 'qed-table.c',
85 'qed.c',
86 ))
87endif
88if get_option('parallels').allowed()
89 block_ss.add(files('parallels.c', 'parallels-ext.c'))
90endif
91
5e5733e5
MAL
92block_ss.add(when: 'CONFIG_WIN32', if_true: files('file-win32.c', 'win32-aio.c'))
93block_ss.add(when: 'CONFIG_POSIX', if_true: [files('file-posix.c'), coref, iokit])
9db405a3 94block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c'))
5e5733e5 95block_ss.add(when: 'CONFIG_LINUX', if_true: files('nvme.c'))
43c71fe3 96if get_option('replication').allowed()
406523f6
PB
97 block_ss.add(files('replication.c'))
98endif
ff66f3e5 99block_ss.add(when: libaio, if_true: files('linux-aio.c'))
63a7f853 100block_ss.add(when: linux_io_uring, if_true: files('io_uring.c'))
5e5733e5
MAL
101
102block_modules = {}
103
104modsrc = []
105foreach m : [
fd66dbd4 106 [blkio, 'blkio', files('blkio.c')],
96acfb1f
PB
107 [curl, 'curl', files('curl.c')],
108 [glusterfs, 'gluster', files('gluster.c')],
7fa1c635 109 [libiscsi, 'iscsi', [files('iscsi.c'), libm]],
96acfb1f
PB
110 [libnfs, 'nfs', files('nfs.c')],
111 [libssh, 'ssh', files('ssh.c')],
112 [rbd, 'rbd', files('rbd.c')],
5e5733e5 113]
2f2a376a 114 if m[0].found()
96acfb1f
PB
115 module_ss = ss.source_set()
116 module_ss.add(when: m[0], if_true: m[2])
5e5733e5 117 if enable_modules
96acfb1f 118 modsrc += module_ss.all_sources()
5e5733e5 119 endif
5e5733e5
MAL
120 block_modules += {m[1] : module_ss}
121 endif
122endforeach
123
124# those are not exactly regular block modules, so treat them apart
ed793c2c 125if get_option('dmg').allowed()
5e5733e5 126 foreach m : [
2f2a376a
PB
127 [liblzfse, 'dmg-lzfse', liblzfse, 'dmg-lzfse.c'],
128 [libbzip2, 'dmg-bz2', [glib, libbzip2], 'dmg-bz2.c']
5e5733e5 129 ]
2f2a376a 130 if m[0].found()
5e5733e5
MAL
131 module_ss = ss.source_set()
132 module_ss.add(when: m[2], if_true: files(m[3]))
133 block_modules += {m[1] : module_ss}
134 endif
135 endforeach
136endif
137
138module_block_py = find_program('../scripts/modules/module_block.py')
139module_block_h = custom_target('module_block.h',
140 output: 'module_block.h',
141 input: modsrc,
142 command: [module_block_py, '@OUTPUT0@', modsrc])
143block_ss.add(module_block_h)
144
aaaa20b6
VSO
145wrapper_py = find_program('../scripts/block-coroutine-wrapper.py')
146block_gen_c = custom_target('block-gen.c',
147 output: 'block-gen.c',
3b491a90
EGE
148 input: files(
149 '../include/block/block-io.h',
0508d0be 150 '../include/block/dirty-bitmap.h',
c86422c5 151 '../include/block/block_int-io.h',
3b491a90 152 '../include/block/block-global-state.h',
4bee90e9 153 '../include/sysemu/block-backend-global-state.h',
facbaad9 154 '../include/sysemu/block-backend-io.h',
3b491a90
EGE
155 'coroutines.h'
156 ),
aaaa20b6
VSO
157 command: [wrapper_py, '@OUTPUT@', '@INPUT@'])
158block_ss.add(block_gen_c)
159
5e5733e5
MAL
160block_ss.add(files('stream.c'))
161
de6cd759 162system_ss.add(files('qapi-sysemu.c'))
56ee8626
KW
163
164subdir('export')
5e5733e5
MAL
165subdir('monitor')
166
167modules += {'block': block_modules}