William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 1 | project( |
| 2 | 'google-ipmi-sys', |
| 3 | 'cpp', |
| 4 | version: '0.1', |
Patrick Williams | 9941341 | 2023-07-12 11:16:14 -0500 | [diff] [blame] | 5 | meson_version: '>=1.1.1', |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 6 | default_options: [ |
Patrick Williams | 9941341 | 2023-07-12 11:16:14 -0500 | [diff] [blame] | 7 | 'cpp_std=c++23', |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 8 | 'warning_level=3', |
| 9 | 'werror=true', |
| 10 | ]) |
| 11 | |
Willy Tu | 6c71b0f | 2021-10-10 13:34:41 -0700 | [diff] [blame] | 12 | root_inc = include_directories('.') |
| 13 | |
| 14 | conf_data = configuration_data() |
| 15 | conf_data.set_quoted('STATIC_BIFURCATION_CONFIG', get_option('static-bifurcation')) |
| 16 | conf_h = configure_file( |
| 17 | output: 'config.h', |
| 18 | configuration: conf_data) |
| 19 | |
Nikhil Namjoshi | 5e70dc8 | 2022-09-16 00:36:07 +0000 | [diff] [blame] | 20 | bm_conf_data = configuration_data() |
| 21 | bm_conf_data.set10('BARE_METAL', get_option('bare_metal')) |
Brandon Kim | 3f3ca03 | 2023-03-17 18:49:00 +0000 | [diff] [blame] | 22 | bm_conf_data.set_quoted('BM_SIGNAL_PATH', get_option('bm-signal-path')) |
Nikhil Namjoshi | 5e70dc8 | 2022-09-16 00:36:07 +0000 | [diff] [blame] | 23 | bm_conf_h = configure_file( |
| 24 | output: 'bm_config.h', |
| 25 | configuration: bm_conf_data) |
| 26 | |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 27 | meson.get_compiler('cpp').has_header_symbol( |
| 28 | 'ipmid/api.h', |
| 29 | 'ipmid_get_sd_bus_connection') |
| 30 | |
Willy Tu | c5b5523 | 2023-11-01 09:27:40 -0700 | [diff] [blame] | 31 | stdplus = dependency('stdplus') |
Willy Tu | 6c71b0f | 2021-10-10 13:34:41 -0700 | [diff] [blame] | 32 | subdir('bifurcation') |
| 33 | |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 34 | sys_pre = declare_dependency( |
Willy Tu | 6c71b0f | 2021-10-10 13:34:41 -0700 | [diff] [blame] | 35 | include_directories: root_inc, |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 36 | dependencies: [ |
Patrick Williams | f3fe8df | 2023-12-07 11:56:19 -0600 | [diff] [blame] | 37 | dependency('nlohmann_json', include_type: 'system'), |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 38 | dependency('phosphor-dbus-interfaces'), |
| 39 | dependency('phosphor-logging'), |
| 40 | dependency('sdbusplus'), |
Willy Tu | c5b5523 | 2023-11-01 09:27:40 -0700 | [diff] [blame] | 41 | stdplus, |
Willy Tu | 6c71b0f | 2021-10-10 13:34:41 -0700 | [diff] [blame] | 42 | bifurcation_dep, |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 43 | ]) |
| 44 | |
| 45 | sys_lib = static_library( |
| 46 | 'sys', |
Brandon Kim | 93a4c0a | 2024-08-17 00:36:55 +0000 | [diff] [blame] | 47 | 'bios_setting.cpp', |
Brandon Kim | 559cb01 | 2024-05-03 09:12:07 +0000 | [diff] [blame] | 48 | 'bm_instance.cpp', |
Nikhil Namjoshi | 5e70dc8 | 2022-09-16 00:36:07 +0000 | [diff] [blame] | 49 | 'bmc_mode.cpp', |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 50 | '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 Wedig | a92d0e6 | 2023-06-29 10:43:47 -0700 | [diff] [blame] | 58 | 'linux_boot_done.cpp', |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 59 | 'machine_name.cpp', |
| 60 | 'pcie_i2c.cpp', |
Steve Foreman | 4f0d1de | 2021-09-20 14:06:32 -0700 | [diff] [blame] | 61 | 'google_accel_oob.cpp', |
Willy Tu | 6c71b0f | 2021-10-10 13:34:41 -0700 | [diff] [blame] | 62 | 'pcie_bifurcation.cpp', |
Hao Zhou | 15d4d21 | 2023-07-11 20:18:04 +0000 | [diff] [blame] | 63 | 'file_system_wrapper.cpp', |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 64 | 'psu.cpp', |
| 65 | 'util.cpp', |
| 66 | implicit_include_directories: false, |
| 67 | dependencies: sys_pre) |
| 68 | |
| 69 | sys_dep = declare_dependency( |
| 70 | link_with: sys_lib, |
| 71 | dependencies: sys_pre) |
| 72 | |
| 73 | if not get_option('tests').disabled() |
| 74 | subdir('test') |
| 75 | endif |
| 76 | |
| 77 | shared_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 | |
| 88 | systemd_dep = dependency('systemd') |
| 89 | if systemd_dep.found() |
| 90 | install_data( |
| 91 | 'gbmc-host-poweroff.target', |
| 92 | 'gbmc-psu-hardreset.target', |
William A. Kennington III | 0e22d32 | 2022-04-07 12:32:36 -0700 | [diff] [blame] | 93 | 'gbmc-psu-hardreset-pre.target', |
| 94 | 'gbmc-psu-hardreset-time.service', |
Willy Tu | 1209ccc | 2023-05-19 00:49:51 -0700 | [diff] [blame] | 95 | install_dir: systemd_dep.get_variable('systemdsystemunitdir')) |
William A. Kennington III | ac730af | 2021-06-24 03:15:38 -0700 | [diff] [blame] | 96 | endif |
Willy Tu | 40b2a0c | 2023-10-31 10:09:42 -0700 | [diff] [blame] | 97 | |
| 98 | install_data( |
| 99 | 'gbmc-enqueue-powercycle.sh', |
| 100 | install_dir: get_option('bindir'), |
| 101 | install_mode: 'rwxr-xr-x' |
| 102 | ) |