1sdbuspp_prog = find_program('sdbus++')
2
3domain = 'xyz.openbmc_project.Ipmi.Internal.SoftPowerOff'
4if_yaml_file = files('../SoftPowerOff.interface.yaml')
5
6if_cpp = custom_target(
7  'server.cpp',
8  output: 'server.cpp',
9  input: if_yaml_file,
10  capture: true,
11  command: [sdbuspp_prog, '-r', root, 'interface', 'server-cpp', domain])
12
13if_hpp = custom_target(
14  'server.hpp',
15  output: 'server.hpp',
16  input: if_yaml_file,
17  capture: true,
18  command: [sdbuspp_prog, '-r', root, 'interface', 'server-header', domain],
19  install: true,
20  install_dir: get_option('includedir') / 'xyz/openbmc_project/Ipmi/Internal/SoftPowerOff')
21
22if_common_hpp = custom_target(
23  'common.hpp',
24  output: 'common.hpp',
25  input: if_yaml_file,
26  capture: true,
27  command: [sdbuspp_prog, '-r', root, 'interface', 'common-header', domain],
28  install: true,
29  install_dir: get_option('includedir') / 'xyz/openbmc_project/Ipmi/Internal/SoftPowerOff')
30
31softoff_dbus_deps = [
32  dependency('phosphor-dbus-interfaces'),
33  dependency('sdbusplus'),
34]
35
36softoff_dbus_lib = library(
37  'softoff-dbus',
38  [
39    if_cpp,
40    if_hpp,
41    if_common_hpp,
42  ],
43  implicit_include_directories: false,
44  include_directories: root_inc,
45  version: meson.project_version(),
46  dependencies: softoff_dbus_deps,
47  override_options: ['b_lundef=false'],
48  install: true)
49
50softoff_dbus = declare_dependency(
51  dependencies: softoff_dbus_deps,
52  sources: [if_hpp, if_common_hpp],
53  link_with: softoff_dbus_lib)
54
55softoff_dbus_reqs = []
56foreach dep : softoff_dbus_deps
57  if dep.type_name() == 'pkgconfig'
58    softoff_dbus_reqs += dep
59  endif
60endforeach
61
62import('pkgconfig').generate(
63  name: 'softoff-dbus',
64  description: 'SoftPowerOff DBus Bindings',
65  version: meson.project_version(),
66  libraries: softoff_dbus,
67  requires: softoff_dbus_reqs)
68