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