-
Notifications
You must be signed in to change notification settings - Fork 36
/
meson.build
99 lines (85 loc) · 2.64 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
project(
'rauc-hawkbit-updater',
'c',
version : '1.3',
meson_version : '>=0.50',
default_options: [
'warning_level=3',
],
license : 'LGPL-2.1-only',
)
conf = configuration_data()
conf.set_quoted('PROJECT_VERSION', meson.project_version())
libcurldep = dependency('libcurl', version : '>=7.47.0')
giodep = dependency('gio-2.0', version : '>=2.26.0')
giounixdep = dependency('gio-unix-2.0', version : '>=2.26.0')
jsonglibdep = dependency('json-glib-1.0')
incdir = include_directories('include')
sources_updater = [
'src/rauc-hawkbit-updater.c',
'src/rauc-installer.c',
'src/config-file.c',
'src/hawkbit-client.c',
'src/json-helper.c',
'src/log.c',
]
c_args = '''
-Wbad-function-cast
-Wcast-align
-Wdeclaration-after-statement
-Wformat=2
-Wshadow
-Wno-unused-parameter
-Wno-missing-field-initializers
'''.split()
add_project_arguments(c_args, language : 'c')
systemddep = dependency('systemd', required : get_option('systemd'))
libsystemddep = dependency('libsystemd', required : get_option('systemd'))
if systemddep.found()
conf.set('WITH_SYSTEMD', '1')
sources_updater += 'src/sd-helper.c'
systemdsystemunitdir = get_option('systemdsystemunitdir')
if systemdsystemunitdir == ''
systemdsystemunitdir = systemddep.get_pkgconfig_variable('systemdsystemunitdir')
endif
install_data('script/rauc-hawkbit-updater.service', install_dir : systemdsystemunitdir)
endif
gnome = import('gnome')
dbus = 'rauc-installer-gen'
dbus_ifaces = files('src/rauc-installer.xml')
dbus_sources = gnome.gdbus_codegen(
dbus,
sources : dbus_ifaces,
interface_prefix : 'de.pengutronix.rauc.',
namespace: 'R',
)
config_h = configure_file(
output : 'config.h',
configuration : conf
)
add_project_arguments('-include' + meson.current_build_dir() / 'config.h', language: 'c')
doxygen = find_program('doxygen', required : get_option('apidoc'))
if doxygen.found()
doc_config = configuration_data()
doc_config.set('DOXYGEN_OUTPUT', meson.current_build_dir() / 'doxygen')
doc_config.set('DOXYGEN_INPUT', meson.current_source_dir() / 'src' + ' ' + meson.current_source_dir() / 'include')
doxyfile = configure_file(input : 'Doxyfile.in',
output : 'Doxyfile',
configuration : doc_config,
install : false)
custom_target('doxygen',
output : 'doxygen',
input : doxyfile,
command : [doxygen, '@INPUT@'],
depend_files : sources_updater,
build_by_default : get_option('apidoc').enabled(),
)
endif
subdir('docs')
executable('rauc-hawkbit-updater',
sources_updater,
dbus_sources,
config_h,
dependencies : [libcurldep, giodep, giounixdep, jsonglibdep, libsystemddep],
include_directories : incdir,
install: true)