qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 039/142] meson: convert qom directory to Meson


From: Paolo Bonzini
Subject: [PATCH 039/142] meson: convert qom directory to Meson
Date: Tue, 28 Jan 2020 18:51:59 +0100

From: Marc-André Lureau <address@hidden>

Signed-off-by: Marc-André Lureau <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
 Makefile               |  2 +-
 Makefile.objs          |  4 ++--
 Makefile.target        |  3 ++-
 meson.build            |  1 +
 qom/Makefile.objs      |  3 ---
 qom/meson.build        | 15 +++++++++++++++
 tests/Makefile.include |  2 +-
 7 files changed, 22 insertions(+), 8 deletions(-)
 create mode 100644 qom/meson.build

diff --git a/Makefile b/Makefile
index e863250107..80894601dc 100644
--- a/Makefile
+++ b/Makefile
@@ -225,7 +225,6 @@ dummy := $(call unnest-vars,, \
                 block-obj-y \
                 block-obj-m \
                 crypto-obj-y \
-                qom-obj-y \
                 io-obj-y \
                 common-obj-y \
                 common-obj-m)
@@ -245,6 +244,7 @@ $(SOFTMMU_ALL_RULES): $(block-obj-y)
 $(SOFTMMU_ALL_RULES): $(chardev-obj-y)
 $(SOFTMMU_ALL_RULES): $(crypto-obj-y)
 $(SOFTMMU_ALL_RULES): $(io-obj-y)
+$(SOFTMMU_ALL_RULES): $(qom-obj-y)
 $(SOFTMMU_ALL_RULES): config-all-devices.mak
 
 .PHONY: $(TARGET_DIRS_RULES)
diff --git a/Makefile.objs b/Makefile.objs
index f1465a620e..18caccdba8 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -24,9 +24,9 @@ block-obj-m = block/
 crypto-obj-y = crypto/
 
 #######################################################################
-# qom-obj-y is code used by both qemu system emulation and qemu-img
+# libraries built entirely from meson
 
-qom-obj-y = qom/
+qom-obj-y = qom/libqom.fa
 
 #######################################################################
 # io-obj-y is code used by both qemu system emulation and qemu-img
diff --git a/Makefile.target b/Makefile.target
index d94fa687bf..40ab105568 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -178,13 +178,14 @@ dummy := $(call unnest-vars,,obj-y)
 all-obj-y := $(obj-y)
 
 include $(SRC_PATH)/Makefile.objs
+dummy := $(call fix-paths,../,, \
+              qom-obj-y)
 dummy := $(call unnest-vars,.., \
                authz-obj-y \
                block-obj-y \
                block-obj-m \
                chardev-obj-y \
                crypto-obj-y \
-               qom-obj-y \
                io-obj-y \
                common-obj-y \
                common-obj-m)
diff --git a/meson.build b/meson.build
index 585fc7aca5..0c4e5e5823 100644
--- a/meson.build
+++ b/meson.build
@@ -287,6 +287,7 @@ libqemuutil = static_library('qemuutil',
 qemuutil = declare_dependency(link_with: libqemuutil,
                               sources: version_res)
 
+subdir('qom')
 subdir('fsdev')
 
 # Other build targets
diff --git a/qom/Makefile.objs b/qom/Makefile.objs
index f9d77350ac..fc1248e3f3 100644
--- a/qom/Makefile.objs
+++ b/qom/Makefile.objs
@@ -1,4 +1 @@
-qom-obj-y = object.o container.o qom-qobject.o
-qom-obj-y += object_interfaces.o
-
 common-obj-$(CONFIG_SOFTMMU) += qom-hmp-cmds.o qom-qmp-cmds.o
diff --git a/qom/meson.build b/qom/meson.build
new file mode 100644
index 0000000000..3c41ed37e4
--- /dev/null
+++ b/qom/meson.build
@@ -0,0 +1,15 @@
+qom_ss = ss.source_set()
+qom_ss.add(files(
+  'container.c',
+  'object.c',
+  'object_interfaces.c',
+  'qom-qobject.c',
+))
+
+qom_ss = qom_ss.apply(config_host, strict: false)
+libqom = static_library('qom', qom_ss.sources(),
+                        dependencies: [qom_ss.dependencies()],
+                        link_with: [libqemuutil],
+                        name_suffix: 'fa')
+
+qom = declare_dependency(link_whole: libqom)
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 7838a45a18..62b65f409d 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -511,7 +511,7 @@ QEMU_CFLAGS += -I$(SRC_PATH)/tests
 
 # Deps that are common to various different sets of tests below
 test-util-obj-y = libqemuutil.a
-test-qom-obj-y = $(qom-obj-y) $(test-util-obj-y)
+test-qom-obj-y = qom/libqom.fa $(test-util-obj-y)
 test-qapi-obj-y = tests/test-qapi-types.o \
        tests/include/test-qapi-types-sub-module.o \
        tests/test-qapi-types-sub-sub-module.o \
-- 
2.21.0





reply via email to

[Prev in Thread] Current Thread [Next in Thread]