forked from shramov/tll-http
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
78 lines (63 loc) · 2.48 KB
/
meson.build
File metadata and controls
78 lines (63 loc) · 2.48 KB
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
project('tll-ws', 'c', 'cpp', version: '0.2.0', default_options: ['cpp_std=c++17', 'c_std=c11', 'werror=true', 'optimization=2', 'b_lto=true'])
cc = meson.get_compiler('c')
if cc.get_id() == 'gcc' and cc.version().version_compare('< 8.0')
add_project_arguments('-Wno-unused-variable', language: 'cpp')
endif
include = [include_directories('src')]
tll = dependency('tll')
fmt = dependency('fmt')
curl = dependency('libcurl') #, version: '>=7.63', required: false, disabler: true)
libuv = dependency('libuv')
lws = dependency('libwebsockets', required: get_option('with_lws'), disabler: true)
libev = meson.get_compiler('c').find_library('ev', required: get_option('with_lws'), disabler: true)
rst2man = find_program('rst2man', disabler: true, required: false)
libev_lib = static_library('libev-tll', 'src/ev.cc', dependencies: [fmt, tll])
libev_tll = declare_dependency(include_directories: ['src', 'src/tll-ev'], link_with: libev_lib)
lib = shared_library('tll-ws',
['src/channel.cc', 'src/names.cc', 'src/ev-backend.c'],
include_directories : include,
dependencies : [fmt, lws, tll, libev],
install : true
)
subdir('third_party')
uws = shared_library('tll-uws',
['src/uws.cc', 'src/uws-epoll.c'],
include_directories : include,
dependencies : [fmt, tll, libuv, uwebsockets, usockets],
install : true
)
uwsc = shared_library('tll-uwsc',
['src/uwsc.cc', 'src/ev-backend.c'],
include_directories : include,
dependencies : [fmt, tll, libuwsc, libev_tll],
install : true
)
curl = shared_library('tll-curl',
['src/curl.cc'],
include_directories : include,
dependencies : [fmt, tll, curl],
install : true
)
executable('bench-getrandom', 'bench/random.cc', dependencies: [fmt, tll, openssl])
install_data(['src/http.yaml', 'src/ws.yaml'], install_dir: get_option('datadir') / 'tll/scheme/tll/')
test('pytest', import('python').find_installation('python3')
, args: ['-m', 'pytest', '-v', 'tests']
, env: 'BUILD_DIR=@0@'.format(meson.current_build_dir())
, workdir: meson.current_source_dir()
)
foreach f : ['ws.rst', 'curl.rst', 'uws.rst']
custom_target('channel-man-@0@'.format(f)
, input: 'doc' / f
, output : 'tll-channel-@BASENAME@.7'
, command : [rst2man, '@INPUT@', '@OUTPUT@']
, install_dir: get_option('mandir') / 'man7'
, install: true
)
endforeach
custom_target('man-http'
, input: 'doc/http.rst'
, output : 'tll-http.7'
, command : [rst2man, '@INPUT@', '@OUTPUT@']
, install_dir: get_option('mandir') / 'man7'
, install: true
)