forked from eclipse-bluechi/bluechi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
88 lines (67 loc) · 2.49 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
# SPDX-License-Identifier: GPL-2.0-or-later
project(
'hirte',
'c',
version: '0.5.0',
license: 'GPL-2.0-or-later',
default_options: [
'c_std=gnu17', # Adds "-std=gnu17". Includes GNU 17 extensions.
'warning_level=2', # Adds "-Wextra". Enables additional warnings.
'debug=true', # Adds "-g". Object files include debugging symbols.
'werror=true' # Adds "-Werror". Treat warnings as errors.
]
)
test_cflags = [ '-Wno-cast-function-type' ]
cc = meson.get_compiler('c')
common_cflags = cc.get_supported_arguments(test_cflags)
# Link with systemd shared library.
systemd_dep = dependency('libsystemd')
# Set option to use either the session or system D-Bus
api_bus = get_option('api_bus')
if api_bus == 'user'
common_cflags += '-DUSE_USER_API_BUS'
endif
# inih library options
# Set option of maximum line length
# 500 characters for actual value
# 20 characters as buffer (key, library internal usage, etc.)
common_cflags += '-DINI_MAX_LINE=520'
# Set option to abort parsing on first error
common_cflags += '-DINI_STOP_ON_FIRST_ERROR=1'
# Build time configuration header file
conf = configuration_data()
# Enable GNU extensions.
conf.set('_GNU_SOURCE', true)
prefixdir = get_option('prefix')
conf.set_quoted('CONFIG_H_SYSCONFDIR', join_paths(prefixdir, get_option('sysconfdir')))
conf.set_quoted('CONFIG_H_DATADIR', join_paths(prefixdir, get_option('datadir')))
conf.set_quoted('CONFIG_H_HIRTE_VERSION', meson.project_version())
config_h = configure_file(
output : 'config.h',
configuration : conf)
# For lint to work properly the same include needs to be added manually to clang-tidy arguments
add_project_arguments('-include', 'config.h', language : 'c')
# Subdirectory for the shared library.
subdir('src/libhirte')
# Configuration files
subdir('config')
# selinux
subdir('selinux')
# build each binary
subdir('src/manager')
subdir('src/agent')
subdir('src/client')
subdir('src/proxy')
# Subdirectory for the API description
subdir('data')
# Subdirectory for the man documentation
subdir('doc/man')
# systemd unit files
subdir('systemd-units')
# add custom clang-tidy target since default auto-generated ninja target doesn't support passing compilation options
# overrides the auto-generated ninja target clang-tidy
clangtidy = find_program('clang-tidy', required : false)
if clangtidy.found()
run_target('clang-tidy', command : ['build-scripts/clang-tidy-all.sh'])
run_target('clang-tidy-fix', command : ['build-scripts/clang-tidy-all.sh', '--fix'])
endif