diff mbox series

[107/132] meson: accel

Message ID 1576758232-12439-16-git-send-email-pbonzini@redhat.com
State New
Headers show
Series Proof of concept for Meson integration | expand

Commit Message

Paolo Bonzini Dec. 19, 2019, 12:23 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 Makefile.target           |  1 -
 accel/Makefile.objs       |  5 -----
 accel/kvm/Makefile.objs   |  2 --
 accel/kvm/meson.build     |  5 +++++
 accel/meson.build         |  6 ++++++
 accel/stubs/Makefile.objs |  5 -----
 accel/stubs/meson.build   |  5 +++++
 accel/tcg/Makefile.objs   |  8 --------
 accel/tcg/meson.build     | 14 ++++++++++++++
 meson.build               |  1 +
 10 files changed, 31 insertions(+), 21 deletions(-)
 delete mode 100644 accel/Makefile.objs
 delete mode 100644 accel/kvm/Makefile.objs
 create mode 100644 accel/kvm/meson.build
 create mode 100644 accel/meson.build
 delete mode 100644 accel/stubs/Makefile.objs
 create mode 100644 accel/stubs/meson.build
 delete mode 100644 accel/tcg/Makefile.objs
 create mode 100644 accel/tcg/meson.build
diff mbox series

Patch

diff --git a/Makefile.target b/Makefile.target
index bc5a019..438d27b 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -110,7 +110,6 @@  obj-y += trace/
 #########################################################
 # cpu emulator library
 obj-y += exec.o
-obj-y += accel/
 obj-$(CONFIG_TCG) += tcg/tcg.o tcg/tcg-op.o tcg/tcg-op-vec.o tcg/tcg-op-gvec.o
 obj-$(CONFIG_TCG) += tcg/tcg-common.o tcg/optimize.o
 obj-$(CONFIG_TCG_INTERPRETER) += tcg/tci.o
diff --git a/accel/Makefile.objs b/accel/Makefile.objs
deleted file mode 100644
index 8b498d3..0000000
--- a/accel/Makefile.objs
+++ /dev/null
@@ -1,5 +0,0 @@ 
-obj-$(CONFIG_SOFTMMU) += accel.o
-obj-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_POSIX)) += qtest.o
-obj-$(CONFIG_KVM) += kvm/
-obj-$(CONFIG_TCG) += tcg/
-obj-y += stubs/
diff --git a/accel/kvm/Makefile.objs b/accel/kvm/Makefile.objs
deleted file mode 100644
index fdfa481..0000000
--- a/accel/kvm/Makefile.objs
+++ /dev/null
@@ -1,2 +0,0 @@ 
-obj-y += kvm-all.o
-obj-$(call lnot,$(CONFIG_SEV)) += sev-stub.o
diff --git a/accel/kvm/meson.build b/accel/kvm/meson.build
new file mode 100644
index 0000000..4db2388
--- /dev/null
+++ b/accel/kvm/meson.build
@@ -0,0 +1,5 @@ 
+kvm_ss = ss.source_set()
+kvm_ss.add(files('kvm-all.c'))
+kvm_ss.add(when: 'CONFIG_SEV', if_false: files('sev-stub.c'))
+
+specific_ss.add_all(when: 'CONFIG_KVM', if_true: kvm_ss)
diff --git a/accel/meson.build b/accel/meson.build
new file mode 100644
index 0000000..c356284
--- /dev/null
+++ b/accel/meson.build
@@ -0,0 +1,6 @@ 
+specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files('accel.c'))
+specific_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_POSIX'], if_true: files('qtest.c'))
+
+subdir('kvm')
+subdir('tcg')
+subdir('stubs')
diff --git a/accel/stubs/Makefile.objs b/accel/stubs/Makefile.objs
deleted file mode 100644
index 3894caf..0000000
--- a/accel/stubs/Makefile.objs
+++ /dev/null
@@ -1,5 +0,0 @@ 
-obj-$(call lnot,$(CONFIG_HAX))  += hax-stub.o
-obj-$(call lnot,$(CONFIG_HVF))  += hvf-stub.o
-obj-$(call lnot,$(CONFIG_WHPX)) += whpx-stub.o
-obj-$(call lnot,$(CONFIG_KVM))  += kvm-stub.o
-obj-$(call lnot,$(CONFIG_TCG))  += tcg-stub.o
diff --git a/accel/stubs/meson.build b/accel/stubs/meson.build
new file mode 100644
index 0000000..8456de4
--- /dev/null
+++ b/accel/stubs/meson.build
@@ -0,0 +1,5 @@ 
+specific_ss.add(when: 'CONFIG_HAX', if_false: files('hax-stub.c'))
+specific_ss.add(when: 'CONFIG_HVF', if_false: files('hvf-stub.c'))
+specific_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c'))
+specific_ss.add(when: 'CONFIG_TCG', if_false: files('tcg-stub.c'))
+specific_ss.add(when: 'CONFIG_WHPX', if_false: files('whpx-stub.c'))
diff --git a/accel/tcg/Makefile.objs b/accel/tcg/Makefile.objs
deleted file mode 100644
index d381a02..0000000
--- a/accel/tcg/Makefile.objs
+++ /dev/null
@@ -1,8 +0,0 @@ 
-obj-$(CONFIG_SOFTMMU) += tcg-all.o
-obj-$(CONFIG_SOFTMMU) += cputlb.o
-obj-y += tcg-runtime.o tcg-runtime-gvec.o
-obj-y += cpu-exec.o cpu-exec-common.o translate-all.o
-obj-y += translator.o
-
-obj-$(CONFIG_USER_ONLY) += user-exec.o
-obj-$(call lnot,$(CONFIG_SOFTMMU)) += user-exec-stub.o
diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build
new file mode 100644
index 0000000..605810a
--- /dev/null
+++ b/accel/tcg/meson.build
@@ -0,0 +1,14 @@ 
+tcg_ss = ss.source_set()
+tcg_ss.add(files(
+  'cpu-exec-common.c',
+  'cpu-exec.c',
+  'tcg-runtime-gvec.c',
+  'tcg-runtime.c',
+  'translate-all.c',
+  'translator.c',
+))
+tcg_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-exec.c'))
+tcg_ss.add(when: 'CONFIG_SOFTMMU', if_false: files('user-exec-stub.c'))
+specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss)
+
+specific_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files('tcg-all.c', 'cputlb.c'))
diff --git a/meson.build b/meson.build
index c8428c0..1c9a941 100644
--- a/meson.build
+++ b/meson.build
@@ -645,6 +645,7 @@  subdir('replay')
 subdir('hw')
 subdir('libdecnumber')
 subdir('target')
+subdir('accel')
 
 mods = []
 block_mods = []