xref: /openbmc/qemu/block/meson.build (revision f0830823)
1block_ss.add(genh)
2block_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  'vhdx-endian.c',
42  'vhdx-log.c',
43  'vhdx.c',
44  'vmdk.c',
45  'vpc.c',
46  'write-threshold.c',
47), zstd, zlib, gnutls)
48
49softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('blkreplay.c'))
50softmmu_ss.add(files('block-ram-registrar.c'))
51
52if get_option('qcow1').allowed()
53  block_ss.add(files('qcow.c'))
54endif
55if get_option('vdi').allowed()
56  block_ss.add(files('vdi.c'))
57endif
58if get_option('cloop').allowed()
59  block_ss.add(files('cloop.c'))
60endif
61if get_option('bochs').allowed()
62  block_ss.add(files('bochs.c'))
63endif
64if get_option('vvfat').allowed()
65  block_ss.add(files('vvfat.c'))
66endif
67if get_option('dmg').allowed()
68  block_ss.add(files('dmg.c'))
69endif
70if get_option('qed').allowed()
71  block_ss.add(files(
72    'qed-check.c',
73    'qed-cluster.c',
74    'qed-l2-cache.c',
75    'qed-table.c',
76    'qed.c',
77  ))
78endif
79if get_option('parallels').allowed()
80  block_ss.add(files('parallels.c', 'parallels-ext.c'))
81endif
82
83block_ss.add(when: 'CONFIG_WIN32', if_true: files('file-win32.c', 'win32-aio.c'))
84block_ss.add(when: 'CONFIG_POSIX', if_true: [files('file-posix.c'), coref, iokit])
85block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c'))
86block_ss.add(when: 'CONFIG_LINUX', if_true: files('nvme.c'))
87if not get_option('replication').disabled()
88  block_ss.add(files('replication.c'))
89endif
90block_ss.add(when: libaio, if_true: files('linux-aio.c'))
91block_ss.add(when: linux_io_uring, if_true: files('io_uring.c'))
92
93block_modules = {}
94
95modsrc = []
96foreach m : [
97  [blkio, 'blkio', files('blkio.c')],
98  [curl, 'curl', files('curl.c')],
99  [glusterfs, 'gluster', files('gluster.c')],
100  [libiscsi, 'iscsi', [files('iscsi.c'), libm]],
101  [libnfs, 'nfs', files('nfs.c')],
102  [libssh, 'ssh', files('ssh.c')],
103  [rbd, 'rbd', files('rbd.c')],
104]
105  if m[0].found()
106    module_ss = ss.source_set()
107    module_ss.add(when: m[0], if_true: m[2])
108    if enable_modules
109      modsrc += module_ss.all_sources()
110    endif
111    block_modules += {m[1] : module_ss}
112  endif
113endforeach
114
115# those are not exactly regular block modules, so treat them apart
116if get_option('dmg').allowed()
117  foreach m : [
118    [liblzfse, 'dmg-lzfse', liblzfse, 'dmg-lzfse.c'],
119    [libbzip2, 'dmg-bz2', [glib, libbzip2], 'dmg-bz2.c']
120  ]
121    if m[0].found()
122      module_ss = ss.source_set()
123      module_ss.add(when: m[2], if_true: files(m[3]))
124      block_modules += {m[1] : module_ss}
125    endif
126  endforeach
127endif
128
129module_block_py = find_program('../scripts/modules/module_block.py')
130module_block_h = custom_target('module_block.h',
131                               output: 'module_block.h',
132                               input: modsrc,
133                               command: [module_block_py, '@OUTPUT0@', modsrc])
134block_ss.add(module_block_h)
135
136wrapper_py = find_program('../scripts/block-coroutine-wrapper.py')
137block_gen_c = custom_target('block-gen.c',
138                            output: 'block-gen.c',
139                            input: files(
140                                      '../include/block/block-io.h',
141                                      '../include/block/dirty-bitmap.h',
142                                      '../include/block/block_int-io.h',
143                                      '../include/block/block-global-state.h',
144                                      '../include/sysemu/block-backend-global-state.h',
145                                      '../include/sysemu/block-backend-io.h',
146                                      'coroutines.h'
147                                      ),
148                            command: [wrapper_py, '@OUTPUT@', '@INPUT@'])
149block_ss.add(block_gen_c)
150
151block_ss.add(files('stream.c'))
152
153softmmu_ss.add(files('qapi-sysemu.c'))
154
155subdir('export')
156subdir('monitor')
157
158modules += {'block': block_modules}
159