summaryrefslogtreecommitdiff
path: root/egg/meson.build
blob: d2badac9b545a0e29b26f932cdba41e9e8c4152c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
libegg_sources = [
  'egg-hex.c',
  'egg-secure-memory.c',
  'egg-testing.c',
]

libegg_deps = [
  glib_deps,
]

if get_option('gcrypt')
  libegg_sources += [
    'egg-dh.c',
    'egg-hkdf.c',
    'egg-libgcrypt.c',
  ]

  libegg_deps += gcrypt_dep
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 get_option('gcrypt')
  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