blob: 4e07ddd5f119861ba0a5e5fe4f09ea65672abdd9 [file] [log] [blame]
William A. Kennington IIIac730af2021-06-24 03:15:38 -07001project(
2 'google-ipmi-sys',
3 'cpp',
4 version: '0.1',
Patrick Williams99413412023-07-12 11:16:14 -05005 meson_version: '>=1.1.1',
William A. Kennington IIIac730af2021-06-24 03:15:38 -07006 default_options: [
Patrick Williams99413412023-07-12 11:16:14 -05007 'cpp_std=c++23',
William A. Kennington IIIac730af2021-06-24 03:15:38 -07008 'warning_level=3',
9 'werror=true',
10 ])
11
Willy Tu6c71b0f2021-10-10 13:34:41 -070012root_inc = include_directories('.')
13
14conf_data = configuration_data()
15conf_data.set_quoted('STATIC_BIFURCATION_CONFIG', get_option('static-bifurcation'))
16conf_h = configure_file(
17 output: 'config.h',
18 configuration: conf_data)
19
Nikhil Namjoshi5e70dc82022-09-16 00:36:07 +000020bm_conf_data = configuration_data()
21bm_conf_data.set10('BARE_METAL', get_option('bare_metal'))
Brandon Kim3f3ca032023-03-17 18:49:00 +000022bm_conf_data.set_quoted('BM_SIGNAL_PATH', get_option('bm-signal-path'))
Nikhil Namjoshi5e70dc82022-09-16 00:36:07 +000023bm_conf_h = configure_file(
24 output: 'bm_config.h',
25 configuration: bm_conf_data)
26
William A. Kennington IIIac730af2021-06-24 03:15:38 -070027meson.get_compiler('cpp').has_header_symbol(
28 'ipmid/api.h',
29 'ipmid_get_sd_bus_connection')
30
Willy Tuc5b55232023-11-01 09:27:40 -070031stdplus = dependency('stdplus')
Willy Tu6c71b0f2021-10-10 13:34:41 -070032subdir('bifurcation')
33
William A. Kennington IIIac730af2021-06-24 03:15:38 -070034sys_pre = declare_dependency(
Willy Tu6c71b0f2021-10-10 13:34:41 -070035 include_directories: root_inc,
William A. Kennington IIIac730af2021-06-24 03:15:38 -070036 dependencies: [
Patrick Williamsf3fe8df2023-12-07 11:56:19 -060037 dependency('nlohmann_json', include_type: 'system'),
William A. Kennington IIIac730af2021-06-24 03:15:38 -070038 dependency('phosphor-dbus-interfaces'),
39 dependency('phosphor-logging'),
40 dependency('sdbusplus'),
Willy Tuc5b55232023-11-01 09:27:40 -070041 stdplus,
Willy Tu6c71b0f2021-10-10 13:34:41 -070042 bifurcation_dep,
William A. Kennington IIIac730af2021-06-24 03:15:38 -070043 ])
44
45sys_lib = static_library(
46 'sys',
Brandon Kim93a4c0a2024-08-17 00:36:55 +000047 'bios_setting.cpp',
Brandon Kim559cb012024-05-03 09:12:07 +000048 'bm_instance.cpp',
Nikhil Namjoshi5e70dc82022-09-16 00:36:07 +000049 'bmc_mode.cpp',
William A. Kennington IIIac730af2021-06-24 03:15:38 -070050 'cable.cpp',
51 'cpld.cpp',
52 'entity_name.cpp',
53 'eth.cpp',
54 'flash_size.cpp',
55 'handler.cpp',
56 'host_power_off.cpp',
57 'ipmi.cpp',
John Wediga92d0e62023-06-29 10:43:47 -070058 'linux_boot_done.cpp',
William A. Kennington IIIac730af2021-06-24 03:15:38 -070059 'machine_name.cpp',
60 'pcie_i2c.cpp',
Steve Foreman4f0d1de2021-09-20 14:06:32 -070061 'google_accel_oob.cpp',
Willy Tu6c71b0f2021-10-10 13:34:41 -070062 'pcie_bifurcation.cpp',
Hao Zhou15d4d212023-07-11 20:18:04 +000063 'file_system_wrapper.cpp',
William A. Kennington IIIac730af2021-06-24 03:15:38 -070064 'psu.cpp',
65 'util.cpp',
66 implicit_include_directories: false,
67 dependencies: sys_pre)
68
69sys_dep = declare_dependency(
70 link_with: sys_lib,
71 dependencies: sys_pre)
72
73if not get_option('tests').disabled()
74 subdir('test')
75endif
76
77shared_module(
78 'googlesys',
79 'main.cpp',
80 implicit_include_directories: false,
81 dependencies: [
82 dependency('libipmid'),
83 sys_dep,
84 ],
85 install: true,
86 install_dir: get_option('libdir') / 'ipmid-providers')
87
88systemd_dep = dependency('systemd')
89if systemd_dep.found()
90 install_data(
91 'gbmc-host-poweroff.target',
92 'gbmc-psu-hardreset.target',
William A. Kennington III0e22d322022-04-07 12:32:36 -070093 'gbmc-psu-hardreset-pre.target',
94 'gbmc-psu-hardreset-time.service',
Willy Tu1209ccc2023-05-19 00:49:51 -070095 install_dir: systemd_dep.get_variable('systemdsystemunitdir'))
William A. Kennington IIIac730af2021-06-24 03:15:38 -070096endif
Willy Tu40b2a0c2023-10-31 10:09:42 -070097
98install_data(
99 'gbmc-enqueue-powercycle.sh',
100 install_dir: get_option('bindir'),
101 install_mode: 'rwxr-xr-x'
102)