Merge tag 'qemu-macppc-20230206' of https://github.com/mcayland/qemu into staging
[qemu.git] / block / meson.build
blob3662852dc25d1c20d48f603108c71b4b5ab69148
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   'vhdx-endian.c',
42   'vhdx-log.c',
43   'vhdx.c',
44   'vmdk.c',
45   'vpc.c',
46   'write-threshold.c',
47 ), zstd, zlib, gnutls)
49 softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('blkreplay.c'))
50 softmmu_ss.add(files('block-ram-registrar.c'))
52 if get_option('qcow1').allowed()
53   block_ss.add(files('qcow.c'))
54 endif
55 if get_option('vdi').allowed()
56   block_ss.add(files('vdi.c'))
57 endif
58 if get_option('cloop').allowed()
59   block_ss.add(files('cloop.c'))
60 endif
61 if get_option('bochs').allowed()
62   block_ss.add(files('bochs.c'))
63 endif
64 if get_option('vvfat').allowed()
65   block_ss.add(files('vvfat.c'))
66 endif
67 if get_option('dmg').allowed()
68   block_ss.add(files('dmg.c'))
69 endif
70 if 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   ))
78 endif
79 if get_option('parallels').allowed()
80   block_ss.add(files('parallels.c', 'parallels-ext.c'))
81 endif
83 block_ss.add(when: 'CONFIG_WIN32', if_true: files('file-win32.c', 'win32-aio.c'))
84 block_ss.add(when: 'CONFIG_POSIX', if_true: [files('file-posix.c'), coref, iokit])
85 block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c'))
86 block_ss.add(when: 'CONFIG_LINUX', if_true: files('nvme.c'))
87 if not get_option('replication').disabled()
88   block_ss.add(files('replication.c'))
89 endif
90 block_ss.add(when: libaio, if_true: files('linux-aio.c'))
91 block_ss.add(when: linux_io_uring, if_true: files('io_uring.c'))
93 block_modules = {}
95 modsrc = []
96 foreach 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')],
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
113 endforeach
115 # those are not exactly regular block modules, so treat them apart
116 if 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
127 endif
129 module_block_py = find_program('../scripts/modules/module_block.py')
130 module_block_h = custom_target('module_block.h',
131                                output: 'module_block.h',
132                                input: modsrc,
133                                command: [module_block_py, '@OUTPUT0@', modsrc])
134 block_ss.add(module_block_h)
136 wrapper_py = find_program('../scripts/block-coroutine-wrapper.py')
137 block_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-io.h',
145                                       'coroutines.h'
146                                       ),
147                             command: [wrapper_py, '@OUTPUT@', '@INPUT@'])
148 block_ss.add(block_gen_c)
150 block_ss.add(files('stream.c'))
152 softmmu_ss.add(files('qapi-sysemu.c'))
154 subdir('export')
155 subdir('monitor')
157 modules += {'block': block_modules}