mirror of
https://gitlab.gnome.org/GNOME/libsecret.git
synced 2024-12-22 12:48:51 +00:00
28486191b2
This turns the `-Dgcrypt` build time option into a more generic `-Dcrypto` option, which enables user to choose which cryptographic library to link with. It currently supports libgcrypt (`libgcrypt`) and GnuTLS (`gnutls`); for the latter, GnuTLS 3.8.2 is the minimum required version. Signed-off-by: Daiki Ueno <dueno@src.gnome.org>
80 lines
1.2 KiB
Meson
80 lines
1.2 KiB
Meson
libegg_sources = [
|
|
'egg-hex.c',
|
|
'egg-secure-memory.c',
|
|
'egg-testing.c',
|
|
]
|
|
|
|
libegg_deps = [
|
|
glib_deps,
|
|
]
|
|
|
|
if with_crypto
|
|
libegg_sources += [
|
|
'egg-dh.c',
|
|
]
|
|
|
|
if with_gcrypt
|
|
libegg_sources += [
|
|
'egg-dh-libgcrypt.c',
|
|
'egg-hkdf-libgcrypt.c',
|
|
'egg-keyring1-libgcrypt.c',
|
|
'egg-libgcrypt.c',
|
|
]
|
|
elif with_gnutls
|
|
libegg_sources += [
|
|
'egg-dh-gnutls.c',
|
|
'egg-hkdf-gnutls.c',
|
|
'egg-keyring1-gnutls.c',
|
|
]
|
|
endif
|
|
|
|
libegg_deps += crypto_deps
|
|
endif
|
|
|
|
if get_option('tpm2')
|
|
libegg_sources += [
|
|
'egg-tpm2.c',
|
|
]
|
|
|
|
libegg_deps += tss2_deps
|
|
endif
|
|
|
|
libegg = static_library('egg',
|
|
libegg_sources,
|
|
dependencies: libegg_deps,
|
|
include_directories: [config_h_dir, build_dir],
|
|
)
|
|
|
|
# Tests
|
|
test_names = [
|
|
'test-hex',
|
|
'test-secmem',
|
|
]
|
|
|
|
if with_crypto
|
|
test_names += [
|
|
'test-dh',
|
|
'test-hkdf',
|
|
]
|
|
endif
|
|
|
|
if get_option('tpm2')
|
|
test_names += [
|
|
'test-tpm2',
|
|
]
|
|
endif
|
|
|
|
foreach _test : test_names
|
|
|
|
test_bin = executable(_test,
|
|
'@0@.c'.format(_test),
|
|
dependencies: libegg_deps,
|
|
link_with: libegg,
|
|
include_directories: config_h_dir,
|
|
)
|
|
|
|
test(_test, test_bin,
|
|
suite: 'libegg',
|
|
)
|
|
endforeach
|