-
Notifications
You must be signed in to change notification settings - Fork 3
/
meson.build
62 lines (54 loc) · 1.09 KB
/
meson.build
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
project(
'nosj', 'c',
version : '2.2.1',
)
fs = import('fs')
sources = [
'src/json.c',
'src/string.c',
'src/util.c',
'src/format.c',
]
inc = include_directories('inc')
libnosj = library(
'nosj',
sources,
include_directories : inc,
install : true,
)
libnosj_dep = declare_dependency(
include_directories : inc,
link_with : libnosj,
)
pkg = import('pkgconfig')
pkg.generate(
libraries: libnosj,
subdirs: 'inc',
version: meson.project_version(),
name: 'libnosj',
filebase: 'nosj',
description: 'JSON parser',
)
# For each public header in "include/":
install_headers('inc/nosj.h')
tests = [
'test/compare_strings.c',
'test/load_strings.c',
'test/parse_arrays.c',
'test/parse_atomics.c',
'test/parse_numbers.c',
'test/parse_objects.c',
'test/parse_strings.c',
'test/lookup.c',
'test/easy.c',
'test/format.c',
]
unity_dep = dependency(
'Unity',
fallback: ['Unity', 'unity_dep'],
)
foreach t: tests
testname = fs.name(t)
exe = executable('test_' + testname, t, dependencies : [libnosj_dep, unity_dep])
test('TEST_' + testname, exe)
endforeach