Willy Tu | c710b97 | 2021-08-11 16:33:43 -0700 | [diff] [blame] | 1 | sdbuspp_prog = find_program('sdbus++') |
| 2 | |
| 3 | domain = 'xyz.openbmc_project.Ipmi.Internal.SoftPowerOff' |
| 4 | if_yaml_file = files('../SoftPowerOff.interface.yaml') |
| 5 | |
| 6 | if_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 | |
| 13 | if_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 | |
Patrick Williams | 68e8294 | 2023-04-26 11:52:01 -0500 | [diff] [blame^] | 22 | if_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 | |
Willy Tu | c710b97 | 2021-08-11 16:33:43 -0700 | [diff] [blame] | 31 | softoff_dbus_deps = [ |
| 32 | dependency('phosphor-dbus-interfaces'), |
| 33 | dependency('sdbusplus'), |
| 34 | ] |
| 35 | |
| 36 | softoff_dbus_lib = library( |
| 37 | 'softoff-dbus', |
| 38 | [ |
| 39 | if_cpp, |
| 40 | if_hpp, |
Patrick Williams | 68e8294 | 2023-04-26 11:52:01 -0500 | [diff] [blame^] | 41 | if_common_hpp, |
Willy Tu | c710b97 | 2021-08-11 16:33:43 -0700 | [diff] [blame] | 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 | |
| 50 | softoff_dbus = declare_dependency( |
| 51 | dependencies: softoff_dbus_deps, |
Patrick Williams | 68e8294 | 2023-04-26 11:52:01 -0500 | [diff] [blame^] | 52 | sources: [if_hpp, if_common_hpp], |
Willy Tu | c710b97 | 2021-08-11 16:33:43 -0700 | [diff] [blame] | 53 | link_with: softoff_dbus_lib) |
| 54 | |
| 55 | softoff_dbus_reqs = [] |
| 56 | foreach dep : softoff_dbus_deps |
| 57 | if dep.type_name() == 'pkgconfig' |
| 58 | softoff_dbus_reqs += dep |
| 59 | endif |
| 60 | endforeach |
| 61 | |
| 62 | import('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) |