-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmeson.build
182 lines (154 loc) · 4.43 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
project(
'phosphor-user-manager',
'cpp',
version: '0.1',
meson_version: '>=1.1.1',
default_options: [
'warning_level=3',
'werror=true',
'cpp_std=c++23',
'buildtype=debugoptimized',
],
)
if get_option('root_user_mgmt').allowed()
add_project_arguments('-DENABLE_ROOT_USER_MGMT', language: 'cpp')
endif
conf_data = configuration_data()
conf_data.set_quoted(
'USER_MANAGER_BUSNAME',
'xyz.openbmc_project.User.Manager',
description: 'The DBus busname to own.',
)
conf_data.set(
'CLASS_VERSION',
1,
description: 'Class version to register with Cereal.',
)
conf_data.set_quoted(
'LDAP_CONFIG_FILE',
'/etc/nslcd.conf',
description: 'Path of LDAP configuration file.',
)
conf_data.set_quoted(
'TLS_CACERT_PATH',
'/etc/ssl/certs/authority',
description: 'Path of LDAP server CA certificate.',
)
conf_data.set_quoted(
'TLS_CERT_FILE',
'/etc/nslcd/certs/cert.pem',
description: 'Path of LDAP client certificate.',
)
conf_data.set_quoted(
'LDAP_CONFIG_ROOT',
'/xyz/openbmc_project/user/ldap',
description: 'LDAP configuration root.',
)
conf_data.set_quoted(
'LDAP_CONFIG_DBUS_OBJ_PATH',
'/xyz/openbmc_project/user/ldap/config',
description: 'D-Bus path of LDAP config object.',
)
conf_data.set_quoted(
'LDAP_CONFIG_BUSNAME',
'xyz.openbmc_project.Ldap.Config',
description: 'D-Bus busname of LDAP config service.',
)
conf_data.set_quoted(
'LDAP_CONF_PERSIST_PATH',
'/var/lib/phosphor-ldap-conf',
description: 'path of directory having persisted LDAP configuration enabled property.',
)
conf_header = configure_file(output: 'config.h', configuration: conf_data)
phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
sdbusplus_dep = dependency('sdbusplus')
phosphor_logging_dep = dependency('phosphor-logging')
systemd_dep = dependency('systemd')
cpp = meson.get_compiler('cpp')
boost_dep = dependency('boost')
# Get Cereal dependency.
cereal_dep = dependency('cereal', required: false)
has_cereal = cpp.has_header_symbol(
'cereal/cereal.hpp',
'cereal::specialize',
dependencies: cereal_dep,
required: false,
)
if not has_cereal
cereal_opts = import('cmake').subproject_options()
cereal_opts.add_cmake_defines(
{'BUILD_TESTS': 'OFF', 'SKIP_PERFORMANCE_COMPARISON': 'ON'},
)
cereal_proj = import('cmake').subproject(
'cereal',
options: cereal_opts,
required: false,
)
assert(cereal_proj.found(), 'cereal is required')
cereal_dep = cereal_proj.dependency('cereal')
endif
user_manager_src = ['mainapp.cpp', 'user_mgr.cpp', 'users.cpp']
user_manager_deps = [
boost_dep,
sdbusplus_dep,
phosphor_logging_dep,
phosphor_dbus_interfaces_dep,
]
user_manager_lib = static_library(
'phosphor-user-manager',
['user_mgr.cpp', 'users.cpp'],
dependencies: user_manager_deps,
)
user_manager_dep = declare_dependency(
link_with: user_manager_lib,
dependencies: user_manager_deps,
)
executable(
'phosphor-user-manager',
'mainapp.cpp',
dependencies: user_manager_dep,
link_args: ['-lcrypt'],
cpp_args: [
'-DBOOST_ALL_NO_LIB',
'-DBOOST_SYSTEM_NO_DEPRECATED',
'-DBOOST_ERROR_CODE_HEADER_ONLY',
],
install: true,
)
systemd_system_unit_dir = systemd_dep.get_variable('systemdsystemunitdir')
install_data(
'phosphor-nslcd-cert-config.conf',
install_dir: get_option('datadir') / 'dbus-1' / 'system.d',
)
install_data(
'nslcd',
install_dir: get_option('datadir') / 'phosphor-certificate-manager',
)
# Figure out how to use install_symlink to install symlink to a file of another
# recipe
#install_symlink(
# '[email protected]',
# install_dir: systemd_system_unit_dir / 'multi-user.target.wants',
# pointing_to: systemd_system_unit_dir / '[email protected]',
# )
meson.add_install_script(
'sh',
'-c',
'mkdir -p $(dirname $DESTDIR/@0@/@1@)'.format(
systemd_system_unit_dir,
'multi-user.target.wants/[email protected]',
),
)
meson.add_install_script(
'sh',
'-c',
'ln -s @0@ $DESTDIR/@1@/@2@'.format(
'../[email protected]',
systemd_system_unit_dir,
'multi-user.target.wants/[email protected]',
),
)
subdir('phosphor-ldap-config')
if get_option('tests').allowed()
subdir('test')
endif