summaryrefslogtreecommitdiffstats
path: root/lib/meson.build
blob: ec11da9f52cc840fda08bd880298644a8d70e862 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# libkres
# SPDX-License-Identifier: GPL-3.0-or-later

libkres_src = files([
  'cache/api.c',
  'cache/cdb_lmdb.c',
  'cache/entry_list.c',
  'cache/entry_pkt.c',
  'cache/entry_rr.c',
  'cache/knot_pkt.c',
  'cache/nsec1.c',
  'cache/nsec3.c',
  'cache/peek.c',
  'dnssec.c',
  'dnssec/nsec.c',
  'dnssec/nsec3.c',
  'dnssec/signature.c',
  'dnssec/ta.c',
  'generic/lru.c',
  'generic/queue.c',
  'generic/trie.c',
  'layer/cache.c',
  'layer/iterate.c',
  'layer/validate.c',
  'log.c',
  'module.c',
  'resolve.c',
  'rplan.c',
  'selection.c',
  'selection_forward.c',
  'selection_iter.c',
  'utils.c',
  'zonecut.c',
])
c_src_lint += libkres_src

libkres_headers = files([
  'cache/api.h',
  'cache/cdb_api.h',
  'cache/cdb_lmdb.h',
  'cache/impl.h',
  'defines.h',
  'dnssec.h',
  'dnssec/nsec.h',
  'dnssec/nsec3.h',
  'dnssec/signature.h',
  'dnssec/ta.h',
  'generic/array.h',
  'generic/lru.h',
  'generic/pack.h',
  'generic/queue.h',
  'generic/trie.h',
  'layer.h',
  'layer/iterate.h',
  'log.h',
  'module.h',
  'resolve.h',
  'rplan.h',
  'selection.h',
  'selection_forward.h',
  'selection_iter.h',
  'utils.h',
  'zonecut.h',
])

unit_tests += [
  ['array', files('generic/test_array.c')],
  ['lru', files('generic/test_lru.c')],
  ['pack', files('generic/test_pack.c')],
  ['queue', files('generic/test_queue.c')],
  ['trie', files('generic/test_trie.c')],
  ['module', files('test_module.c')],
  ['rplan', files('test_rplan.c')],
  ['utils', files('test_utils.c')],
  ['zonecut', files('test_zonecut.c')],
]

integr_tests += [
  ['cache_overflow', meson.current_source_dir() / 'cache' / 'overflow.test.integr'],
  ['cache_minimal_nsec', meson.current_source_dir() / 'cache' / 'test.integr'],
  ['iter_limits' , meson.current_source_dir() / 'layer' / 'test.integr'],
  ['validate' , meson.current_source_dir() / 'layer' / 'validate.test.integr'],
]

libkres_inc = include_directories('..')

libkres_lib = library('kres',
  libkres_src,
  soversion: libkres_soversion,
  include_directories: libkres_inc,
  dependencies: [
    contrib_dep,
    kresconfig_dep,
    libuv,
    lmdb,
    libknot,
    libdnssec,
    gnutls,
    luajit,
    libsystemd,
  ],
  install: true,
)

libkres_dep = declare_dependency(
  include_directories: libkres_inc,
  link_with: libkres_lib
)

install_headers(
  libkres_headers,
  subdir: 'libkres',
)

pkgconfig = import('pkgconfig')
pkgconfig.generate(
  name: 'libkres',
  description: 'Knot Resolver library',
  url: 'https://knot-resolver.cz/',
  libraries: [libkres_lib],
)