xref: /openbmc/x86-power-control/meson.build (revision 50fe8ee3)
16199ccf4SJason M. Billsproject(
26199ccf4SJason M. Bills    'power-control',
36199ccf4SJason M. Bills    'cpp',
46199ccf4SJason M. Bills    default_options: [
56199ccf4SJason M. Bills        'warning_level=3',
648c94c59SJason M. Bills        'cpp_std=c++20'
76199ccf4SJason M. Bills    ],
86199ccf4SJason M. Bills    license: 'Apache-2.0',
96199ccf4SJason M. Bills    version: '0.1',
106199ccf4SJason M. Bills    meson_version: '>=0.57.0',
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
266199ccf4SJason M. Billsif get_option('chassis-system-reset').enabled()
276199ccf4SJason M. Bills  cpp_args += '-DCHASSIS_SYSTEM_RESET'
286199ccf4SJason M. Billsendif
296199ccf4SJason M. Billsif get_option('use-plt-rst').enabled()
306199ccf4SJason M. Bills  cpp_args += '-DUSE_PLT_RST'
316199ccf4SJason M. Billsendif
326199ccf4SJason M. Bills
336199ccf4SJason M. Billsdeps = [
346199ccf4SJason M. Bills  dependency('libgpiodcxx', fallback: ['libgpiod', 'gpiodcxx_dep'], default_options: ['bindings=cxx']),
356199ccf4SJason M. Bills  dependency('systemd'),
366199ccf4SJason M. Bills  dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']),
37c46ebb49SJason M. Bills  dependency('phosphor-logging', fallback: ['phosphor-logging', 'phosphor_logging_dep']),
38c46ebb49SJason M. Bills
396199ccf4SJason M. Bills]
406199ccf4SJason M. Bills
416199ccf4SJason M. Billsexecutable(
426199ccf4SJason M. Bills  'power-control',
436199ccf4SJason M. Bills  'src/power_control.cpp',
44*50fe8ee3SAndrei Kartashev  include_directories: include_directories('src'),
456199ccf4SJason M. Bills  cpp_args: cpp_args,
466199ccf4SJason M. Bills  dependencies: deps,
476199ccf4SJason M. Bills  install: true,
486199ccf4SJason M. Bills  install_dir: get_option('bindir'))
496199ccf4SJason M. Bills
506199ccf4SJason M. Billssystemd = dependency('systemd')
516199ccf4SJason M. Billsif systemd.found()
526199ccf4SJason M. Bills  install_data(
536199ccf4SJason M. Bills    'service_files/chassis-system-reset.service',
546199ccf4SJason M. Bills    'service_files/chassis-system-reset.target',
556199ccf4SJason M. Bills    'service_files/xyz.openbmc_project.Chassis.Control.Power@.service',
566199ccf4SJason M. Bills    install_dir: systemd.get_variable(pkgconfig: 'systemdsystemunitdir'))
576199ccf4SJason M. Billsendif
586199ccf4SJason M. Bills
596199ccf4SJason M. Billsinstall_data(
606199ccf4SJason M. Bills  'config/power-config-host0.json',
616199ccf4SJason M. Bills  install_dir: '/usr/share/x86-power-control/')
62