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