-
Notifications
You must be signed in to change notification settings - Fork 1
/
meson.build
91 lines (78 loc) · 1.98 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
project('libqril', 'c', 'cpp')
cc = meson.get_compiler('c')
fs = import('fs')
qmic = find_program('qmic')
libqril_include = [
include_directories('.'),
include_directories('lib'),
include_directories('qmi'),
]
libqril_headers = [
'lib/libqril.h',
'lib/libqril_qmi.h',
'lib/libqril_client.hh',
# FIXME: these aren't super well suited here
'lib/list.h',
'lib/q_log.h',
'lib/workqueue.h',
]
libqril_src = [
'libqril.c',
'libqril_client.cc',
'libqril_events.c',
'libqril_messages.c',
'libqril_qmi.c',
'libqril_services.c',
'libqril_services.h',
'lock_tracker.c',
'lock_tracker.h',
'q_log.c',
'qmi_tlv.c',
#'qrild_link.cc',
'timespec.c',
'timespec.h',
'util.c',
'workqueue.c',
]
qmi_srcs = [
'qmi/qril_dms.qmi',
'qmi/qril_dpm.qmi',
'qmi/qril_nas.qmi',
'qmi/qril_uim.qmi',
'qmi/qril_wda.qmi',
'qmi/qril_wds.qmi',
]
qmi_generated = []
foreach qmi : qmi_srcs
basename = qmi.split('_')[1].split('.')[0]
qmi_generated += custom_target('qmi_@0@.[ch]'.format(basename),
output: ['qmi_@[email protected]'.format(basename),
'qmi_@[email protected]'.format(basename)],
input: qmi,
command: [qmic, '-k', '-f', '@INPUT@', '-o', '@OUTDIR@'],
)
endforeach
qmi_dep = declare_dependency(sources: qmi_generated)
libqril_deps = [ # ew
cc.find_library('libqrtr', dirs: ['/usr/lib', '/usr/include']),
qmi_dep,
]
foreach qmi : qmi_generated
# libqril_src += 'qmi/@0@'.format(fs.name(qmi[1].full_path()))
# libqril_headers += '@0@'.format(fs.name(qmi[0].full_path()))
# libqril_src += 'qmi/@0@'.format(fs.name(qmi[1].full_path()))
# message('qmi/@0@'.format(fs.name(qmi[1].full_path())))
endforeach
libqril = shared_library('qril', libqril_src,
sources: libqril_src,
include_directories: libqril_include,
dependencies: libqril_deps,
install: true,
cpp_args: '-Wno-missing-braces'
)
install_headers(libqril_headers, subdir: 'libqril')
libqril_dep = declare_dependency(
include_directories: libqril_include,
link_with: libqril,
)
subdir('examples')