1project( 2 'google-ipmi-sys', 3 'cpp', 4 version: '0.1', 5 meson_version: '>=1.1.1', 6 default_options: [ 7 'cpp_std=c++23', 8 'warning_level=3', 9 'werror=true', 10 ]) 11 12root_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 20bm_conf_data = configuration_data() 21bm_conf_data.set10('BARE_METAL', get_option('bare_metal')) 22bm_conf_data.set_quoted('BM_SIGNAL_PATH', get_option('bm-signal-path')) 23bm_conf_h = configure_file( 24 output: 'bm_config.h', 25 configuration: bm_conf_data) 26 27meson.get_compiler('cpp').has_header_symbol( 28 'ipmid/api.h', 29 'ipmid_get_sd_bus_connection') 30 31stdplus = dependency('stdplus') 32subdir('bifurcation') 33 34sys_pre = declare_dependency( 35 include_directories: root_inc, 36 dependencies: [ 37 dependency('nlohmann_json', include_type: 'system'), 38 dependency('phosphor-dbus-interfaces'), 39 dependency('phosphor-logging'), 40 dependency('sdbusplus'), 41 stdplus, 42 bifurcation_dep, 43 ]) 44 45sys_lib = static_library( 46 'sys', 47 'bios_setting.cpp', 48 'bm_instance.cpp', 49 'bmc_mode.cpp', 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', 58 'linux_boot_done.cpp', 59 'machine_name.cpp', 60 'pcie_i2c.cpp', 61 'google_accel_oob.cpp', 62 'pcie_bifurcation.cpp', 63 'file_system_wrapper.cpp', 64 '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', 93 'gbmc-psu-hardreset-pre.target', 94 'gbmc-psu-hardreset-time.service', 95 install_dir: systemd_dep.get_variable('systemdsystemunitdir')) 96endif 97 98install_data( 99 'gbmc-enqueue-powercycle.sh', 100 install_dir: get_option('bindir'), 101 install_mode: 'rwxr-xr-x' 102) 103