-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
83 lines (73 loc) · 1.91 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
project('u2fhid2bt', [ 'c', 'cpp' ])
libsystemd = dependency('libsystemd', version: '>=237')
systemd = dependency('systemd', version: '>=237')
libhidapi = dependency('hidapi-hidraw')
add_project_arguments([
'-Wall',
'-Wextra',
'-Werror',
'-Wstrict-aliasing',
'-Wchar-subscripts',
'-Wformat-security',
'-Wmissing-declarations',
'-Wmissing-prototypes',
'-Wnested-externs',
'-Wpointer-arith',
'-Wshadow',
'-Wstrict-prototypes',
'-Wtype-limits',
'-Wunused-function',
'-Wno-missing-field-initializers',
'-Wno-unused-command-line-argument',
'-Wno-unused-parameter',
'-Wno-unknown-pragmas',
'-Wno-sign-compare',
], language: 'c')
##
### Installed Code
##
# daemon executable
u2fhid2bt = executable('u2fhid2bt',
'gatt.c',
'gatt.h',
'main.c',
'uhid.c',
'uhid.h',
'u2f.c',
'u2f.h',
dependencies: libsystemd,
install_dir: get_option('libexecdir'),
install: true
)
# unit file
cd = configuration_data()
cd.set('libexecdir', get_option('prefix') + '/' + get_option('libexecdir'))
configure_file(
install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir'),
configuration: cd,
input: 'u2fhid2bt.service.in',
output: 'u2fhid2bt.service',
)
##
### Test Code
##
# daemon which emulates BlueZ with a U2F token nearby
bluez = executable('bluez',
'test/bluez.c',
'u2f.c',
'u2f.h',
dependencies: libsystemd
)
# utility which finds the HID raw device nodes for our devices
list = executable('list', 'test/list.c', dependencies: libhidapi)
# tests to run against the emulated device
hidtest = executable('hidtest',
'test/u2f-tests/u2f_util.cc',
'test/u2f-tests/u2f_util.h',
'test/u2f-tests/HIDTest.cc',
'test/u2f-tests/u2f_hid.h',
'test/u2f-tests/u2f.h',
dependencies: libhidapi
)
# run the tests (requires RW access to /dev/uhid; usually root)
test('tests', find_program('test/runtests'))