xref: /openbmc/x86-power-control/meson.build (revision 61ccc499)
16199ccf4SJason M. Billsproject(
26199ccf4SJason M. Bills    'power-control',
36199ccf4SJason M. Bills    'cpp',
46199ccf4SJason M. Bills    default_options: [
56199ccf4SJason M. Bills        'warning_level=3',
6cc037b89SPatrick Williams        'cpp_std=c++23'
76199ccf4SJason M. Bills    ],
86199ccf4SJason M. Bills    license: 'Apache-2.0',
96199ccf4SJason M. Bills    version: '0.1',
10cc037b89SPatrick Williams    meson_version: '>=1.1.1',
116199ccf4SJason M. Bills)
126199ccf4SJason M. Bills
136199ccf4SJason M. Billsadd_project_arguments(
146199ccf4SJason M. Bills    '-Wno-psabi',
156199ccf4SJason M. Bills    '-DBOOST_SYSTEM_NO_DEPRECATED',
166199ccf4SJason M. Bills    '-DBOOST_ERROR_CODE_HEADER_ONLY',
176199ccf4SJason M. Bills    '-DBOOST_NO_RTTI',
186199ccf4SJason M. Bills    '-DBOOST_NO_TYPEID',
196199ccf4SJason M. Bills    '-DBOOST_ALL_NO_LIB',
206199ccf4SJason M. Bills    '-DBOOST_ASIO_DISABLE_THREADS',
216199ccf4SJason M. Bills    language: 'cpp',
226199ccf4SJason M. Bills)
236199ccf4SJason M. Bills
246199ccf4SJason M. Billscpp_args = []
256199ccf4SJason M. Bills
2668ea8319SPatrick Williamsif get_option('chassis-system-reset').allowed()
276199ccf4SJason M. Bills  cpp_args += '-DCHASSIS_SYSTEM_RESET'
286199ccf4SJason M. Billsendif
2968ea8319SPatrick Williamsif get_option('use-plt-rst').allowed()
306199ccf4SJason M. Bills  cpp_args += '-DUSE_PLT_RST'
316199ccf4SJason M. Billsendif
3268ea8319SPatrick Williamsif get_option('use-acboot').allowed()
3399e8f9dfSAndrei Kartashev  cpp_args += '-DUSE_ACBOOT'
3499e8f9dfSAndrei Kartashevendif
3568ea8319SPatrick Williamsif get_option('ignore-soft-resets-during-post').allowed()
3658e379d1SMatt Simmering  cpp_args += '-DIGNORE_SOFT_RESETS_DURING_POST'
3758e379d1SMatt Simmeringendif
386199ccf4SJason M. Bills
396199ccf4SJason M. Billsdeps = [
40fd672c91SNan Zhou  dependency('libgpiodcxx', default_options: ['bindings=cxx']),
416199ccf4SJason M. Bills  dependency('systemd'),
42fd672c91SNan Zhou  dependency('sdbusplus'),
43fd672c91SNan Zhou  dependency('phosphor-logging'),
44b1e34a11SPatrick Williams  dependency('nlohmann_json', include_type: 'system'),
45*61ccc499SKonstantin Aladyshev  dependency('boost'),
466199ccf4SJason M. Bills]
476199ccf4SJason M. Bills
486199ccf4SJason M. Billsexecutable(
496199ccf4SJason M. Bills  'power-control',
506199ccf4SJason M. Bills  'src/power_control.cpp',
5150fe8ee3SAndrei Kartashev  include_directories: include_directories('src'),
526199ccf4SJason M. Bills  cpp_args: cpp_args,
536199ccf4SJason M. Bills  dependencies: deps,
546199ccf4SJason M. Bills  install: true,
556199ccf4SJason M. Bills  install_dir: get_option('bindir'))
566199ccf4SJason M. Bills
576199ccf4SJason M. Billssystemd = dependency('systemd')
586199ccf4SJason M. Billsif systemd.found()
596199ccf4SJason M. Bills  install_data(
606199ccf4SJason M. Bills    'service_files/chassis-system-reset.service',
616199ccf4SJason M. Bills    'service_files/chassis-system-reset.target',
626199ccf4SJason M. Bills    'service_files/xyz.openbmc_project.Chassis.Control.Power@.service',
63f56ef594SPatrick Williams    install_dir: systemd.get_variable('systemdsystemunitdir'))
646199ccf4SJason M. Billsendif
656199ccf4SJason M. Bills
666199ccf4SJason M. Billsinstall_data(
676199ccf4SJason M. Bills  'config/power-config-host0.json',
686199ccf4SJason M. Bills  install_dir: '/usr/share/x86-power-control/')
69