-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
168 lines (136 loc) · 4.24 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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#### Project configuration ####
project(
'juptune',
'd',
license: 'MPL-2.0',
version: '0.0.1',
)
# Meson has crappy bugs for its basic functionality that will take 200 years to be addressed:
# https://github.com/mesonbuild/meson/issues/11999
#### Dependencies ####
juptune_d_versions = []
libsodium_dep = dependency('libsodium', version: '>=1.0.18')
if libsodium_dep.found() # Currently not optional, but just in case in the future.
message('Found libsodium, enabling Juptune_LibSodium.')
juptune_d_versions += ['Juptune_LibSodium']
else
error('No cryptography library found.')
endif
summary({
'D Versions': juptune_d_versions,
}, section: 'Dependencies')
#### Sources ####
core_srcs = files(
'./src/juptune/core/ds/alloc.d',
'./src/juptune/core/ds/array.d',
'./src/juptune/core/ds/block.d',
'./src/juptune/core/ds/hashmap.d',
'./src/juptune/core/ds/package.d',
'./src/juptune/core/ds/string.d',
'./src/juptune/core/ds/string2.d',
'./src/juptune/core/util/ansi.d',
'./src/juptune/core/util/conv.d',
'./src/juptune/core/util/maths.d',
'./src/juptune/core/util/package.d',
'./src/juptune/core/util/result.d',
'./src/juptune/core/util/statemachine.d',
'./src/juptune/core/util/utf.d',
'./src/juptune/core/internal/linux.d',
)
crypto_srcs = files(
'./src/juptune/crypto/aead.d',
'./src/juptune/crypto/libsodium.di',
'./src/juptune/crypto/memory.d',
'./src/juptune/crypto/package.d',
'./src/juptune/crypto/rng.d',
)
data_srcs = files(
'./src/juptune/data/base.d',
'./src/juptune/data/buffer.d',
'./src/juptune/data/package.d',
'./src/juptune/data/asn1/decode/bcd/encoding.d',
)
event_srcs = files(
'./src/juptune/event/fiber.d',
'./src/juptune/event/io.d',
'./src/juptune/event/iouring.d',
'./src/juptune/event/loop.d',
'./src/juptune/event/package.d',
)
http_srcs = files(
'./src/juptune/http/common.d',
'./src/juptune/http/client.d',
'./src/juptune/http/package.d',
'./src/juptune/http/tls13.d',
'./src/juptune/http/uri.d',
'./src/juptune/http/v1.d',
)
#### Dependencies ####
juptune_core_dep = declare_dependency(
include_directories: include_directories('src'),
sources: core_srcs,
d_module_versions: juptune_d_versions,
)
juptune_data_dep = declare_dependency(
sources: data_srcs,
dependencies: [juptune_core_dep],
)
juptune_crypto_dep = declare_dependency(
sources: crypto_srcs,
dependencies: [juptune_core_dep, juptune_data_dep, libsodium_dep],
)
juptune_event_dep = declare_dependency(
sources: event_srcs,
dependencies: [juptune_core_dep],
)
juptune_http_dep = declare_dependency(
sources: http_srcs,
dependencies: [juptune_core_dep, juptune_crypto_dep, juptune_event_dep],
)
juptune_all_dep = declare_dependency(
dependencies: [juptune_core_dep, juptune_crypto_dep, juptune_data_dep, juptune_event_dep, juptune_http_dep],
)
juptune_test_dep = declare_dependency(
sources: './src/dummy_main.d',
dependencies: [juptune_all_dep],
)
#### Executables ####
examples = {
'http-hello-world-hardcoded': ['./examples/http-hello-world-hardcoded/main.d'],
'http-echo-low-level': ['./examples/http-echo-low-level/main.d'],
'http-client-curl': ['./examples/http-client-curl/main.d'],
}
example_exes = []
foreach example_name, example_srcs : examples
example_exes += executable(
'juptune-'+example_name,
example_srcs,
dependencies: [juptune_all_dep],
build_by_default: false,
)
endforeach
alias_target('examples', example_exes)
juptune_all_unittest_exe = executable(
'juptune-unittest',
dependencies: [juptune_test_dep],
d_unittest: true,
)
#### Install ####
install_subdir('src/juptune', install_dir: 'include/d/juptune/')
juptune_lib = library(
meson.project_name(),
dependencies: juptune_all_dep,
install: true,
version: meson.project_version(),
)
pkgc = import('pkgconfig')
pkgc.generate(
name: meson.project_name(),
description: 'High-performance iouring-based I/O framework for D.',
version: meson.project_version(),
subdirs: 'd/juptune',
url: 'https://www.github.com/Juptune/juptune',
libraries: [juptune_lib],
)
#### Tests ####
test('juptune-unittest', juptune_all_unittest_exe)