blob: ee347986fcaa11ff975a1bc4f2ee0ac1d4218d2f [file] [log] [blame]
William A. Kennington IIIac730af2021-06-24 03:15:38 -07001project(
2 'google-ipmi-sys',
3 'cpp',
4 version: '0.1',
Willy Tuc841bfd2021-09-14 15:26:58 -07005 meson_version: '>=0.57.0',
William A. Kennington IIIac730af2021-06-24 03:15:38 -07006 default_options: [
Willy Tuc841bfd2021-09-14 15:26:58 -07007 'cpp_std=c++20',
William A. Kennington IIIac730af2021-06-24 03:15:38 -07008 'warning_level=3',
9 'werror=true',
10 ])
11
12meson.get_compiler('cpp').has_header_symbol(
13 'ipmid/api.h',
14 'ipmid_get_sd_bus_connection')
15
16json_dep = dependency('nlohmann_json', required: false)
17meson.get_compiler('cpp').has_header_symbol(
18 'nlohmann/json.hpp',
19 'nlohmann::json',
20 dependencies: json_dep)
21
22sys_pre = declare_dependency(
23 include_directories: include_directories('.'),
24 dependencies: [
25 json_dep,
26 dependency('phosphor-dbus-interfaces'),
27 dependency('phosphor-logging'),
28 dependency('sdbusplus'),
29 ])
30
31sys_lib = static_library(
32 'sys',
33 'cable.cpp',
34 'cpld.cpp',
35 'entity_name.cpp',
36 'eth.cpp',
37 'flash_size.cpp',
38 'handler.cpp',
39 'host_power_off.cpp',
40 'ipmi.cpp',
41 'machine_name.cpp',
42 'pcie_i2c.cpp',
Steve Foreman4f0d1de2021-09-20 14:06:32 -070043 'google_accel_oob.cpp',
William A. Kennington IIIac730af2021-06-24 03:15:38 -070044 'psu.cpp',
45 'util.cpp',
46 implicit_include_directories: false,
47 dependencies: sys_pre)
48
49sys_dep = declare_dependency(
50 link_with: sys_lib,
51 dependencies: sys_pre)
52
53if not get_option('tests').disabled()
54 subdir('test')
55endif
56
57shared_module(
58 'googlesys',
59 'main.cpp',
60 implicit_include_directories: false,
61 dependencies: [
62 dependency('libipmid'),
63 sys_dep,
64 ],
65 install: true,
66 install_dir: get_option('libdir') / 'ipmid-providers')
67
68systemd_dep = dependency('systemd')
69if systemd_dep.found()
70 install_data(
71 'gbmc-host-poweroff.target',
72 'gbmc-psu-hardreset.target',
73 install_dir: systemd_dep.get_variable(pkgconfig: 'systemdsystemunitdir'))
74endif