-
Notifications
You must be signed in to change notification settings - Fork 82
/
meson.build
96 lines (82 loc) · 2.22 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
project('sdbusplus', 'cpp', 'c',
default_options: [
'buildtype=debugoptimized',
'cpp_std=c++23',
'warning_level=3',
'werror=true',
'tests=' + (meson.is_subproject() ? 'disabled' : 'auto'),
'examples=' + (meson.is_subproject() ? 'disabled' : 'auto'),
],
version: '1.0.0',
meson_version: '>=1.1.1',
)
libsystemd_pkg = dependency('libsystemd')
nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
python = import('python')
python_bin = python.find_installation('python3', modules:['inflection', 'yaml', 'mako'])
if not python_bin.found()
error('No valid python3 installation found')
endif
root_inc = include_directories('include')
libsdbusplus_src = files(
'src/async/context.cpp',
'src/async/match.cpp',
'src/bus.cpp',
'src/bus/match.cpp',
'src/event.cpp',
'src/exception.cpp',
'src/message/native_types.cpp',
'src/sdbus.cpp',
'src/server/interface.cpp',
'src/server/transaction.cpp',
)
libsdbusplus = library(
'sdbusplus',
libsdbusplus_src,
include_directories: root_inc,
dependencies: [
libsystemd_pkg,
nlohmann_json_dep
],
version: meson.project_version(),
install: true,
)
boost_compile_args = [
'-DBOOST_ASIO_DISABLE_THREADS',
'-DBOOST_ALL_NO_LIB',
'-DBOOST_SYSTEM_NO_DEPRECATED',
'-DBOOST_ERROR_CODE_HEADER_ONLY',
'-DBOOST_COROUTINES_NO_DEPRECATION_WARNING',
]
boost_dep = declare_dependency(
dependencies: dependency('boost', required: false),
compile_args: boost_compile_args)
sdbusplus_dep = declare_dependency(
include_directories: root_inc,
link_with: libsdbusplus,
dependencies: [
boost_dep,
libsystemd_pkg,
nlohmann_json_dep,
],
)
subdir('tools')
if not get_option('examples').disabled()
subdir('example')
endif
if not get_option('tests').disabled()
subdir('test')
endif
install_subdir(
'include/sdbusplus',
install_dir: get_option('includedir'),
strip_directory: false,
)
import('pkgconfig').generate(
libsdbusplus,
name: meson.project_name(),
version: meson.project_version(),
requires: libsystemd_pkg,
extra_cflags: boost_compile_args,
description: 'C++ bindings for sdbus',
)