1project( 2 'power-control', 3 'cpp', 4 default_options: [ 5 'warning_level=3', 6 'cpp_std=c++17' 7 ], 8 license: 'Apache-2.0', 9 version: '0.1', 10 meson_version: '>=0.57.0', 11) 12 13add_project_arguments( 14 '-Wno-psabi', 15 '-DBOOST_SYSTEM_NO_DEPRECATED', 16 '-DBOOST_ERROR_CODE_HEADER_ONLY', 17 '-DBOOST_NO_RTTI', 18 '-DBOOST_NO_TYPEID', 19 '-DBOOST_ALL_NO_LIB', 20 '-DBOOST_ASIO_DISABLE_THREADS', 21 language: 'cpp', 22) 23 24cpp_args = [] 25 26if get_option('chassis-system-reset').enabled() 27 cpp_args += '-DCHASSIS_SYSTEM_RESET' 28endif 29if get_option('use-plt-rst').enabled() 30 cpp_args += '-DUSE_PLT_RST' 31endif 32 33deps = [ 34 dependency('libgpiodcxx', fallback: ['libgpiod', 'gpiodcxx_dep'], default_options: ['bindings=cxx']), 35 dependency('systemd'), 36 dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']), 37] 38 39executable( 40 'power-control', 41 'src/power_control.cpp', 42 cpp_args: cpp_args, 43 dependencies: deps, 44 install: true, 45 install_dir: get_option('bindir')) 46 47systemd = dependency('systemd') 48if systemd.found() 49 install_data( 50 'service_files/chassis-system-reset.service', 51 'service_files/chassis-system-reset.target', 52 'service_files/xyz.openbmc_project.Chassis.Control.Power@.service', 53 install_dir: systemd.get_variable(pkgconfig: 'systemdsystemunitdir')) 54endif 55 56install_data( 57 'config/power-config-host0.json', 58 install_dir: '/usr/share/x86-power-control/')