1user_channel_inc = include_directories('.')
2
3channellayer_pre = declare_dependency(
4  include_directories: [root_inc, user_channel_inc],
5  dependencies: [
6    crypto,
7    ipmid_dep,
8    nlohmann_json_dep,
9    phosphor_dbus_interfaces_dep,
10    phosphor_logging_dep,
11    systemd,
12  ])
13
14channellayer_src = [
15  'channel_layer.cpp',
16  'channel_mgmt.cpp',
17  'cipher_mgmt.cpp',
18]
19
20channellayer_lib = library(
21  'channellayer',
22  channellayer_src,
23  implicit_include_directories: false,
24  dependencies: channellayer_pre,
25  version: meson.project_version(),
26  install: true,
27  install_dir: get_option('libdir'),
28  override_options: ['b_lundef=false'])
29
30channellayer_dep = declare_dependency(
31  link_with: channellayer_lib,
32  dependencies: channellayer_pre)
33
34import('pkgconfig').generate(
35  channellayer_lib,
36  name: 'libchannellayer',
37  version: meson.project_version(),
38  description: 'libchannellayer')
39
40if not get_option('libuserlayer').disabled()
41  userlayer_pre = declare_dependency(
42    include_directories: [root_inc, user_channel_inc],
43    dependencies: [
44      channellayer_dep,
45      crypto,
46      ipmid_dep,
47      nlohmann_json_dep,
48      pam,
49      phosphor_dbus_interfaces_dep,
50      phosphor_logging_dep,
51      systemd,
52    ])
53
54  userlayer_src = [
55    'user_layer.cpp',
56    'user_mgmt.cpp',
57    'passwd_mgr.cpp',
58  ]
59
60  userlayer_lib = library(
61    'userlayer',
62    userlayer_src,
63    implicit_include_directories: false,
64    dependencies: userlayer_pre,
65    version: meson.project_version(),
66    install: true,
67    install_dir: get_option('libdir'),
68    override_options: ['b_lundef=false'])
69
70  userlayer_dep = declare_dependency(
71    link_with: userlayer_lib,
72    dependencies: userlayer_pre)
73
74  usercmds_pre = declare_dependency(
75    include_directories: [root_inc, user_channel_inc],
76    dependencies: [
77      phosphor_logging_dep,
78      ipmid_dep,
79      userlayer_dep,
80      channellayer_dep,
81    ])
82
83  usercmds_lib = library(
84    'usercmds',
85    'usercommands.cpp',
86    implicit_include_directories: false,
87    dependencies: usercmds_pre,
88    install: true,
89    install_dir: get_option('libdir') / 'ipmid-providers',
90    version: meson.project_version(),
91    override_options: ['b_lundef=false'])
92
93  import('pkgconfig').generate(
94    userlayer_lib,
95    name: 'libuserlayer',
96    version: meson.project_version(),
97    description: 'libuserlayer')
98
99endif
100