blob: 24403ad6f70ee8ca16877f0ba05a91f7564c55cb [file] [log] [blame]
Jason M. Bills6199ccf2021-10-21 14:48:59 -07001project(
2 'power-control',
3 'cpp',
4 default_options: [
5 'warning_level=3',
Jason M. Bills48c94c52021-10-19 14:36:14 -07006 'cpp_std=c++20'
Jason M. Bills6199ccf2021-10-21 14:48:59 -07007 ],
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
Andrei Kartashev99e8f9d2022-01-09 12:15:05 +030032if get_option('use-acboot').enabled()
33 cpp_args += '-DUSE_ACBOOT'
34endif
Jason M. Bills6199ccf2021-10-21 14:48:59 -070035
36deps = [
Nan Zhoufd672c92022-09-05 22:58:12 +000037 dependency('libgpiodcxx', default_options: ['bindings=cxx']),
Jason M. Bills6199ccf2021-10-21 14:48:59 -070038 dependency('systemd'),
Nan Zhoufd672c92022-09-05 22:58:12 +000039 dependency('sdbusplus'),
40 dependency('phosphor-logging'),
Jason M. Bills6199ccf2021-10-21 14:48:59 -070041]
42
43executable(
44 'power-control',
45 'src/power_control.cpp',
Andrei Kartashev50fe8ee2022-01-04 21:24:22 +030046 include_directories: include_directories('src'),
Jason M. Bills6199ccf2021-10-21 14:48:59 -070047 cpp_args: cpp_args,
48 dependencies: deps,
49 install: true,
50 install_dir: get_option('bindir'))
51
52systemd = dependency('systemd')
53if systemd.found()
54 install_data(
55 'service_files/chassis-system-reset.service',
56 'service_files/chassis-system-reset.target',
57 'service_files/xyz.openbmc_project.Chassis.Control.Power@.service',
58 install_dir: systemd.get_variable(pkgconfig: 'systemdsystemunitdir'))
59endif
60
61install_data(
62 'config/power-config-host0.json',
Andrei Kartashev50fe8ee2022-01-04 21:24:22 +030063 install_dir: '/usr/share/x86-power-control/')