2018-03-20 21:03:56 +00:00
|
|
|
libegg_sources = [
|
|
|
|
'egg-hex.c',
|
|
|
|
'egg-secure-memory.c',
|
2023-11-15 08:15:09 +00:00
|
|
|
'egg-unix-credentials.c',
|
|
|
|
'egg-buffer.c',
|
2018-03-20 21:03:56 +00:00
|
|
|
'egg-testing.c',
|
|
|
|
]
|
|
|
|
|
2019-05-12 15:51:04 +00:00
|
|
|
libegg_deps = [
|
|
|
|
glib_deps,
|
|
|
|
]
|
|
|
|
|
2023-09-10 02:42:06 +00:00
|
|
|
if with_crypto
|
2018-03-20 21:03:56 +00:00
|
|
|
libegg_sources += [
|
|
|
|
'egg-dh.c',
|
|
|
|
]
|
|
|
|
|
2023-09-10 02:42:06 +00:00
|
|
|
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
|
2019-05-12 15:51:04 +00:00
|
|
|
endif
|
2018-03-20 21:03:56 +00:00
|
|
|
|
2021-07-02 12:00:06 +00:00
|
|
|
if get_option('tpm2')
|
|
|
|
libegg_sources += [
|
|
|
|
'egg-tpm2.c',
|
|
|
|
]
|
|
|
|
|
|
|
|
libegg_deps += tss2_deps
|
|
|
|
endif
|
|
|
|
|
2018-03-20 21:03:56 +00:00
|
|
|
libegg = static_library('egg',
|
|
|
|
libegg_sources,
|
|
|
|
dependencies: libegg_deps,
|
2023-11-15 08:15:09 +00:00
|
|
|
c_args: [
|
|
|
|
'-D_GNU_SOURCE',
|
|
|
|
],
|
2019-09-20 15:32:14 +00:00
|
|
|
include_directories: [config_h_dir, build_dir],
|
2018-03-20 21:03:56 +00:00
|
|
|
)
|
2021-07-03 16:54:04 +00:00
|
|
|
|
|
|
|
# Tests
|
|
|
|
test_names = [
|
|
|
|
'test-hex',
|
|
|
|
'test-secmem',
|
|
|
|
]
|
|
|
|
|
2023-09-10 02:42:06 +00:00
|
|
|
if with_crypto
|
2021-07-03 16:54:04 +00:00
|
|
|
test_names += [
|
|
|
|
'test-dh',
|
|
|
|
'test-hkdf',
|
|
|
|
]
|
|
|
|
endif
|
|
|
|
|
2021-07-02 12:00:06 +00:00
|
|
|
if get_option('tpm2')
|
|
|
|
test_names += [
|
|
|
|
'test-tpm2',
|
|
|
|
]
|
|
|
|
endif
|
|
|
|
|
2021-07-03 16:54:04 +00:00
|
|
|
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
|