aboutsummaryrefslogtreecommitdiff
path: root/crypto/meson.build
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-07-16 19:28:54 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-08-21 06:30:16 -0400
commit5582c58f82b2a356cac721af2e973a6fc6880fc1 (patch)
treef5319c1297a01abad5d14abae925e43e300c180a /crypto/meson.build
parent5e7fbd25157342b3b983779939419fb328e00f4c (diff)
meson: convert crypto directory to Meson
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'crypto/meson.build')
-rw-r--r--crypto/meson.build52
1 files changed, 52 insertions, 0 deletions
diff --git a/crypto/meson.build b/crypto/meson.build
index 1b244315b9..18da7c8541 100644
--- a/crypto/meson.build
+++ b/crypto/meson.build
@@ -1,3 +1,55 @@
+crypto_ss = ss.source_set()
+crypto_ss.add(genh)
+crypto_ss.add(files(
+ 'afsplit.c',
+ 'block-luks.c',
+ 'block-qcow.c',
+ 'block.c',
+ 'cipher.c',
+ 'desrfb.c',
+ 'hash.c',
+ 'hmac.c',
+ 'ivgen-essiv.c',
+ 'ivgen-plain.c',
+ 'ivgen-plain64.c',
+ 'ivgen.c',
+ 'pbkdf.c',
+ 'secret_common.c',
+ 'secret.c',
+ 'tlscreds.c',
+ 'tlscredsanon.c',
+ 'tlscredspsk.c',
+ 'tlscredsx509.c',
+ 'tlssession.c',
+))
+
+if 'CONFIG_GCRYPT' in config_host
+ wo_nettle = files('hash-gcrypt.c', 'pbkdf-gcrypt.c')
+else
+ wo_nettle = files('hash-glib.c', 'pbkdf-stub.c')
+endif
+if 'CONFIG_GCRYPT_HMAC' not in config_host
+ wo_nettle += files('hmac-glib.c')
+endif
+crypto_ss.add(when: [nettle, 'CONFIG_NETTLE'],
+ if_true: files('hash-nettle.c', 'hmac-nettle.c', 'pbkdf-nettle.c'),
+ if_false: wo_nettle)
+
+crypto_ss.add(when: 'CONFIG_SECRET_KEYRING', if_true: files('secret_keyring.c'))
+crypto_ss.add(when: 'CONFIG_QEMU_PRIVATE_XTS', if_true: files('xts.c'))
+crypto_ss.add(when: 'CONFIG_GCRYPT_HMAC', if_true: files('hmac-gcrypt.c'))
+crypto_ss.add(when: 'CONFIG_AF_ALG', if_true: files('afalg.c', 'cipher-afalg.c', 'hash-afalg.c'))
+crypto_ss.add(when: 'CONFIG_GNUTLS', if_true: files('tls-cipher-suites.c'))
+
+crypto_ss = crypto_ss.apply(config_host, strict: false)
+libcrypto = static_library('crypto', crypto_ss.sources() + genh,
+ dependencies: [crypto_ss.dependencies()],
+ name_suffix: 'fa',
+ build_by_default: false)
+
+crypto = declare_dependency(link_whole: libcrypto,
+ dependencies: [authz, qom])
+
util_ss.add(files('aes.c'))
util_ss.add(files('init.c'))
if 'CONFIG_GCRYPT' in config_host