xref: /openbmc/qemu/block/meson.build (revision 6c3a9247)
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  'commit.c',
14  'copy-on-read.c',
15  'preallocate.c',
16  'progress_meter.c',
17  'create.c',
18  'crypto.c',
19  'dirty-bitmap.c',
20  'filter-compress.c',
21  'io.c',
22  'mirror.c',
23  'nbd.c',
24  'null.c',
25  'qapi.c',
26  'qcow2-bitmap.c',
27  'qcow2-cache.c',
28  'qcow2-cluster.c',
29  'qcow2-refcount.c',
30  'qcow2-snapshot.c',
31  'qcow2-threads.c',
32  'qcow2.c',
33  'quorum.c',
34  'raw-format.c',
35  'snapshot.c',
36  'throttle-groups.c',
37  'throttle.c',
38  'vhdx-endian.c',
39  'vhdx-log.c',
40  'vhdx.c',
41  'vmdk.c',
42  'vpc.c',
43  'write-threshold.c',
44), zstd, zlib, gnutls)
45
46softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('blkreplay.c'))
47
48block_ss.add(when: 'CONFIG_QCOW1', if_true: files('qcow.c'))
49block_ss.add(when: 'CONFIG_VDI', if_true: files('vdi.c'))
50block_ss.add(when: 'CONFIG_CLOOP', if_true: files('cloop.c'))
51block_ss.add(when: 'CONFIG_BOCHS', if_true: files('bochs.c'))
52block_ss.add(when: 'CONFIG_VVFAT', if_true: files('vvfat.c'))
53block_ss.add(when: 'CONFIG_DMG', if_true: files('dmg.c'))
54block_ss.add(when: 'CONFIG_QED', if_true: files(
55  'qed-check.c',
56  'qed-cluster.c',
57  'qed-l2-cache.c',
58  'qed-table.c',
59  'qed.c',
60))
61block_ss.add(when: 'CONFIG_PARALLELS', if_true: files('parallels.c', 'parallels-ext.c'))
62block_ss.add(when: 'CONFIG_WIN32', if_true: files('file-win32.c', 'win32-aio.c'))
63block_ss.add(when: 'CONFIG_POSIX', if_true: [files('file-posix.c'), coref, iokit])
64block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c'))
65block_ss.add(when: 'CONFIG_LINUX', if_true: files('nvme.c'))
66block_ss.add(when: 'CONFIG_REPLICATION', if_true: files('replication.c'))
67block_ss.add(when: libaio, if_true: files('linux-aio.c'))
68block_ss.add(when: linux_io_uring, if_true: files('io_uring.c'))
69
70block_modules = {}
71
72modsrc = []
73foreach m : [
74  [curl, 'curl', files('curl.c')],
75  [glusterfs, 'gluster', files('gluster.c')],
76  [libiscsi, 'iscsi', [files('iscsi.c'), libm]],
77  [libnfs, 'nfs', files('nfs.c')],
78  [libssh, 'ssh', files('ssh.c')],
79  [rbd, 'rbd', files('rbd.c')],
80]
81  if m[0].found()
82    module_ss = ss.source_set()
83    module_ss.add(when: m[0], if_true: m[2])
84    if enable_modules
85      modsrc += module_ss.all_sources()
86    endif
87    block_modules += {m[1] : module_ss}
88  endif
89endforeach
90
91# those are not exactly regular block modules, so treat them apart
92if 'CONFIG_DMG' in config_host
93  foreach m : [
94    [liblzfse, 'dmg-lzfse', liblzfse, 'dmg-lzfse.c'],
95    [libbzip2, 'dmg-bz2', [glib, libbzip2], 'dmg-bz2.c']
96  ]
97    if m[0].found()
98      module_ss = ss.source_set()
99      module_ss.add(when: m[2], if_true: files(m[3]))
100      block_modules += {m[1] : module_ss}
101    endif
102  endforeach
103endif
104
105module_block_py = find_program('../scripts/modules/module_block.py')
106module_block_h = custom_target('module_block.h',
107                               output: 'module_block.h',
108                               input: modsrc,
109                               command: [module_block_py, '@OUTPUT0@', modsrc])
110block_ss.add(module_block_h)
111
112wrapper_py = find_program('../scripts/block-coroutine-wrapper.py')
113block_gen_c = custom_target('block-gen.c',
114                            output: 'block-gen.c',
115                            input: files('../include/block/block.h',
116                                         'coroutines.h'),
117                            command: [wrapper_py, '@OUTPUT@', '@INPUT@'])
118block_ss.add(block_gen_c)
119
120block_ss.add(files('stream.c'))
121
122softmmu_ss.add(files('qapi-sysemu.c'))
123
124subdir('export')
125subdir('monitor')
126
127modules += {'block': block_modules}
128