meson: Restrict block subsystem processing

Avoid generating module_block.h and block-gen.c if we are
not going to use them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210122204441.2145197-6-philmd@redhat.com>
[Extend to nearby files and directories. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Philippe Mathieu-Daudé 2021-01-22 21:44:34 +01:00 committed by Paolo Bonzini
parent 6d21d60a2a
commit f285bd3fdc

View file

@ -1877,29 +1877,31 @@ subdir('libdecnumber')
subdir('target') subdir('target')
subdir('dump') subdir('dump')
block_ss.add(files( if have_block
'block.c', block_ss.add(files(
'blockjob.c', 'block.c',
'job.c', 'blockjob.c',
'qemu-io-cmds.c', 'job.c',
)) 'qemu-io-cmds.c',
block_ss.add(when: 'CONFIG_REPLICATION', if_true: files('replication.c')) ))
block_ss.add(when: 'CONFIG_REPLICATION', if_true: files('replication.c'))
subdir('nbd') subdir('nbd')
subdir('scsi') subdir('scsi')
subdir('block') subdir('block')
blockdev_ss.add(files( blockdev_ss.add(files(
'blockdev.c', 'blockdev.c',
'blockdev-nbd.c', 'blockdev-nbd.c',
'iothread.c', 'iothread.c',
'job-qmp.c', 'job-qmp.c',
), gnutls) ), gnutls)
# os-posix.c contains POSIX-specific functions used by qemu-storage-daemon, # os-posix.c contains POSIX-specific functions used by qemu-storage-daemon,
# os-win32.c does not # os-win32.c does not
blockdev_ss.add(when: 'CONFIG_POSIX', if_true: files('os-posix.c')) blockdev_ss.add(when: 'CONFIG_POSIX', if_true: files('os-posix.c'))
softmmu_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')]) softmmu_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')])
endif
common_ss.add(files('cpus-common.c')) common_ss.add(files('cpus-common.c'))