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