[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 076/142] meson: convert hw/virtio
From: |
Paolo Bonzini |
Subject: |
[PATCH 076/142] meson: convert hw/virtio |
Date: |
Tue, 28 Jan 2020 18:52:36 +0100 |
From: Marc-André Lureau <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>
---
hw/Makefile.objs | 1 -
hw/meson.build | 1 +
hw/virtio/Makefile.objs | 41 --------------------------------------
hw/virtio/meson.build | 44 +++++++++++++++++++++++++++++++++++++++++
4 files changed, 45 insertions(+), 42 deletions(-)
delete mode 100644 hw/virtio/Makefile.objs
create mode 100644 hw/virtio/meson.build
diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index 9232919ac3..742b310f13 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -32,7 +32,6 @@ devices-dirs-y += timer/
devices-dirs-$(CONFIG_TPM) += tpm/
devices-dirs-y += usb/
devices-dirs-$(CONFIG_VFIO) += vfio/
-devices-dirs-y += virtio/
endif
common-obj-y += $(devices-dirs-y)
diff --git a/hw/meson.build b/hw/meson.build
index f2209d900c..8338fc4408 100644
--- a/hw/meson.build
+++ b/hw/meson.build
@@ -3,5 +3,6 @@ subdir('mem')
subdir('nubus')
subdir('semihosting')
subdir('smbios')
+subdir('virtio')
subdir('watchdog')
subdir('xen')
diff --git a/hw/virtio/Makefile.objs b/hw/virtio/Makefile.objs
deleted file mode 100644
index de0f5fc39b..0000000000
--- a/hw/virtio/Makefile.objs
+++ /dev/null
@@ -1,41 +0,0 @@
-ifeq ($(CONFIG_VIRTIO),y)
-common-obj-y += virtio-bus.o
-obj-y += virtio.o
-
-obj-$(CONFIG_VHOST) += vhost.o vhost-backend.o
-common-obj-$(call lnot,$(CONFIG_VHOST)) += vhost-stub.o
-obj-$(CONFIG_VHOST_USER) += vhost-user.o
-
-common-obj-$(CONFIG_VIRTIO_RNG) += virtio-rng.o
-common-obj-$(CONFIG_VIRTIO_PCI) += virtio-pci.o
-common-obj-$(CONFIG_VIRTIO_MMIO) += virtio-mmio.o
-obj-$(CONFIG_VIRTIO_BALLOON) += virtio-balloon.o
-obj-$(CONFIG_VIRTIO_CRYPTO) += virtio-crypto.o
-obj-$(CONFIG_VHOST_USER_FS) += vhost-user-fs.o
-obj-$(call land,$(CONFIG_VIRTIO_CRYPTO),$(CONFIG_VIRTIO_PCI)) +=
virtio-crypto-pci.o
-obj-$(CONFIG_VIRTIO_PMEM) += virtio-pmem.o
-common-obj-$(call land,$(CONFIG_VIRTIO_PMEM),$(CONFIG_VIRTIO_PCI)) +=
virtio-pmem-pci.o
-obj-$(call land,$(CONFIG_VHOST_USER_FS),$(CONFIG_VIRTIO_PCI)) +=
vhost-user-fs-pci.o
-obj-$(CONFIG_VHOST_VSOCK) += vhost-vsock.o
-
-ifeq ($(CONFIG_VIRTIO_PCI),y)
-obj-$(CONFIG_VHOST_VSOCK) += vhost-vsock-pci.o
-obj-$(CONFIG_VHOST_USER_BLK) += vhost-user-blk-pci.o
-obj-$(CONFIG_VHOST_USER_INPUT) += vhost-user-input-pci.o
-obj-$(CONFIG_VHOST_USER_SCSI) += vhost-user-scsi-pci.o
-obj-$(CONFIG_VHOST_SCSI) += vhost-scsi-pci.o
-obj-$(CONFIG_VIRTIO_INPUT_HOST) += virtio-input-host-pci.o
-obj-$(CONFIG_VIRTIO_INPUT) += virtio-input-pci.o
-obj-$(CONFIG_VIRTIO_RNG) += virtio-rng-pci.o
-obj-$(CONFIG_VIRTIO_BALLOON) += virtio-balloon-pci.o
-obj-$(CONFIG_VIRTIO_9P) += virtio-9p-pci.o
-obj-$(CONFIG_VIRTIO_SCSI) += virtio-scsi-pci.o
-obj-$(CONFIG_VIRTIO_BLK) += virtio-blk-pci.o
-obj-$(CONFIG_VIRTIO_NET) += virtio-net-pci.o
-obj-$(CONFIG_VIRTIO_SERIAL) += virtio-serial-pci.o
-endif
-else
-common-obj-y += vhost-stub.o
-endif
-
-common-obj-$(CONFIG_ALL) += vhost-stub.o
diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build
new file mode 100644
index 0000000000..561e5c9825
--- /dev/null
+++ b/hw/virtio/meson.build
@@ -0,0 +1,44 @@
+softmmu_virtio_ss = ss.source_set()
+softmmu_virtio_ss.add(files('virtio-bus.c'))
+softmmu_virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true:
files('virtio-rng.c'))
+softmmu_virtio_ss.add(when: 'CONFIG_VIRTIO_PCI', if_true:
files('virtio-pci.c'))
+softmmu_virtio_ss.add(when: 'CONFIG_VIRTIO_MMIO', if_true:
files('virtio-mmio.c'))
+softmmu_virtio_ss.add(when: 'CONFIG_VHOST', if_false: files('vhost-stub.c'))
+softmmu_virtio_ss.add(when: ['CONFIG_VIRTIO_PMEM', 'CONFIG_VIRTIO_PCI'],
if_true: files('virtio-pmem-pci.c'))
+
+softmmu_ss.add_all(when: 'CONFIG_VIRTIO', if_true: softmmu_virtio_ss)
+softmmu_ss.add(when: 'CONFIG_VIRTIO', if_false: files('vhost-stub.c'))
+
+softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('vhost-stub.c'))
+
+virtio_ss = ss.source_set()
+virtio_ss.add(files('virtio.c'))
+virtio_ss.add(when: 'CONFIG_VHOST', if_true: files('vhost.c',
'vhost-backend.c'))
+virtio_ss.add(when: 'CONFIG_VHOST_USER', if_true: files('vhost-user.c'))
+virtio_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true:
files('virtio-balloon.c'))
+virtio_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-crypto.c'))
+virtio_ss.add(when: ['CONFIG_VIRTIO_CRYPTO', 'CONFIG_VIRTIO_PCI'], if_true:
files('virtio-crypto-pci.c'))
+virtio_ss.add(when: 'CONFIG_VHOST_USER_FS', if_true: files('vhost-user-fs.c'))
+virtio_ss.add(when: ['CONFIG_VHOST_USER_FS', 'CONFIG_VIRTIO_PCI'], if_true:
files('vhost-user-fs-pci.c'))
+virtio_ss.add(when: 'CONFIG_VIRTIO_PMEM', if_true: files('virtio-pmem.c'))
+virtio_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true: files('vhost-vsock.c'))
+
+virtio_pci_ss = ss.source_set()
+virtio_pci_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true:
files('vhost-vsock-pci.c'))
+virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true:
files('vhost-user-blk-pci.c'))
+virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_INPUT', if_true:
files('vhost-user-input-pci.c'))
+virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_SCSI', if_true:
files('vhost-user-scsi-pci.c'))
+virtio_pci_ss.add(when: 'CONFIG_VHOST_SCSI', if_true:
files('vhost-scsi-pci.c'))
+virtio_pci_ss.add(when: 'CONFIG_VIRTIO_INPUT_HOST', if_true:
files('virtio-input-host-pci.c'))
+virtio_pci_ss.add(when: 'CONFIG_VIRTIO_INPUT', if_true:
files('virtio-input-pci.c'))
+virtio_pci_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true:
files('virtio-rng-pci.c'))
+virtio_pci_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true:
files('virtio-balloon-pci.c'))
+virtio_pci_ss.add(when: 'CONFIG_VIRTIO_9P', if_true: files('virtio-9p-pci.c'))
+virtio_pci_ss.add(when: 'CONFIG_VIRTIO_SCSI', if_true:
files('virtio-scsi-pci.c'))
+virtio_pci_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true:
files('virtio-blk-pci.c'))
+virtio_pci_ss.add(when: 'CONFIG_VIRTIO_NET', if_true:
files('virtio-net-pci.c'))
+virtio_pci_ss.add(when: 'CONFIG_VIRTIO_SERIAL', if_true:
files('virtio-serial-pci.c'))
+
+virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss)
+
+specific_ss.add_all(when: 'CONFIG_VIRTIO', if_true: virtio_ss)
--
2.21.0
- [PATCH 067/142] meson: convert disas directory to Meson, (continued)
- [PATCH 067/142] meson: convert disas directory to Meson, Paolo Bonzini, 2020/01/28
- [PATCH 066/142] meson: convert fsdev/, Paolo Bonzini, 2020/01/28
- [PATCH 068/142] meson: convert qapi-specific to meson, Paolo Bonzini, 2020/01/28
- [PATCH 069/142] meson: convert hw/xen, Paolo Bonzini, 2020/01/28
- [PATCH 070/142] meson: convert hw/core, Paolo Bonzini, 2020/01/28
- [PATCH 071/142] meson: convert hw/semihosting, Paolo Bonzini, 2020/01/28
- [PATCH 072/142] meson: convert hw/nubus, Paolo Bonzini, 2020/01/28
- [PATCH 073/142] meson: convert hw/smbios, Paolo Bonzini, 2020/01/28
- [PATCH 074/142] meson: convert hw/mem, Paolo Bonzini, 2020/01/28
- [PATCH 075/142] meson: convert hw/watchdog, Paolo Bonzini, 2020/01/28
- [PATCH 076/142] meson: convert hw/virtio,
Paolo Bonzini <=
- [PATCH 078/142] meson: convert hw/usb, Paolo Bonzini, 2020/01/28
- [PATCH 079/142] meson: convert hw/tpm, Paolo Bonzini, 2020/01/28
- [PATCH 077/142] meson: convert hw/vfio, Paolo Bonzini, 2020/01/28
- [PATCH 080/142] meson: convert hw/timer, Paolo Bonzini, 2020/01/28
- [PATCH 081/142] meson: convert hw/rtc, Paolo Bonzini, 2020/01/28
- [PATCH 082/142] meson: convert hw/ssi, Paolo Bonzini, 2020/01/28
- [PATCH 083/142] meson: convert hw/sd, Paolo Bonzini, 2020/01/28
- [PATCH 084/142] meson: convert hw/scsi, Paolo Bonzini, 2020/01/28
- [PATCH 085/142] meson: convert hw/pcmcia, Paolo Bonzini, 2020/01/28
- [PATCH 086/142] meson: convert hw/pci-host, Paolo Bonzini, 2020/01/28