aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-08-19 08:44:56 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-08-21 06:30:08 -0400
commita81df1b68b656f2487f556240baf2af83e60ec6c (patch)
treeeb98104c0a66b6a6d7675055d92c36b60d683796 /crypto
parent245dac4a1bef719d648e20c84bbf3dcaf50de988 (diff)
libqemuutil, qapi, trace: convert to meson
This shows how to do some "computations" in meson.build using its array and dictionary data structures, and also a basic usage of the sourceset module for conditional compilation. Notice the new "if have_system" part of util/meson.build, which fixes a bug in the old build system was buggy: util/dbus.c was built even for non-softmmu builds, but the dependency on -lgio was lost when the linking was done through libqemuutil.a. Because all of its users required gio otherwise, the bug was hidden. Meson instead propagates libqemuutil's dependencies down to its users, and shows the problem. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/Makefile.objs6
-rw-r--r--crypto/meson.build11
2 files changed, 11 insertions, 6 deletions
diff --git a/crypto/Makefile.objs b/crypto/Makefile.objs
index f1965b1a68..a9885919f2 100644
--- a/crypto/Makefile.objs
+++ b/crypto/Makefile.objs
@@ -35,9 +35,3 @@ crypto-obj-$(CONFIG_QEMU_PRIVATE_XTS) += xts.o
crypto-obj-y += block.o
crypto-obj-y += block-qcow.o
crypto-obj-y += block-luks.o
-
-util-obj-$(CONFIG_GCRYPT) += random-gcrypt.o
-util-obj-$(if $(CONFIG_GCRYPT),n,$(CONFIG_GNUTLS)) += random-gnutls.o
-util-obj-$(if $(CONFIG_GCRYPT),n,$(if $(CONFIG_GNUTLS),n,$(CONFIG_RNG_NONE))) += random-none.o
-util-obj-$(if $(CONFIG_GCRYPT),n,$(if $(CONFIG_GNUTLS),n,$(if $(CONFIG_RNG_NONE),n,y))) += random-platform.o
-util-obj-y += aes.o init.o
diff --git a/crypto/meson.build b/crypto/meson.build
new file mode 100644
index 0000000000..1b244315b9
--- /dev/null
+++ b/crypto/meson.build
@@ -0,0 +1,11 @@
+util_ss.add(files('aes.c'))
+util_ss.add(files('init.c'))
+if 'CONFIG_GCRYPT' in config_host
+ util_ss.add(files('random-gcrypt.c'))
+elif 'CONFIG_GNUTLS' in config_host
+ util_ss.add(files('random-gnutls.c'), gnutls)
+elif 'CONFIG_RNG_NONE' in config_host
+ util_ss.add(files('random-none.c'))
+else
+ util_ss.add(files('random-platform.c'))
+endif