blob: 9293f491115d3eb2a20e888664abd303ecc8ef83 [file] [log] [blame]
Jason M. Bills5e1e7e32023-08-03 13:42:18 -07001project(
2 'host-error-monitor',
3 'cpp',
4 version : '1.0',
5 meson_version: '>=1.1.1',
6 default_options: [
7 'b_ndebug=if-release',
8 'cpp_rtti=false',
9 'cpp_std=c++20',
10 'warning_level=3',
11 'werror=true',
12 ]
13)
14
15if(get_option('libpeci').enabled())
16 add_project_arguments('-DLIBPECI', language : 'cpp')
17endif
18
19if(get_option('crashdump').enabled())
20 add_project_arguments('-DCRASHDUMP', language : 'cpp')
21endif
22
Paul Fertser97b5ef22024-01-23 10:07:21 +000023if(get_option('send-to-logger').enabled())
24 add_project_arguments('-DSEND_TO_LOGGING_SERVICE', language : 'cpp')
25endif
26
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070027sdbusplus = dependency('sdbusplus')
28gpiodcxx = dependency('libgpiodcxx',
29 default_options: ['bindings=cxx'],
30)
31
32systemd = dependency('systemd', required: true)
33systemd_system_unit_dir = systemd.get_variable(pkgconfig:
34 'systemdsystemunitdir'
35)
36
Jason M. Bills1b7e5602023-10-03 14:42:23 -070037boost = dependency('boost', version : '>=1.82.0', required : false, include_type: 'system')
38if not boost.found()
39 boost = subproject('boost', required: true).get_variable('boost_dep')
40 boost = boost.as_system('system')
41endif
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070042add_project_arguments(
43 [
44 '-DBOOST_ASIO_DISABLE_THREADS',
45 '-DBOOST_ASIO_EXCEPTION_DISABLE',
46 '-DBOOST_ASIO_NO_DEPRECATED',
47 '-DBOOST_NO_RTTI',
48 '-DBOOST_NO_TYPEID',
49 ],
50 language : 'cpp'
51)
52
Paul Fertser97b5ef22024-01-23 10:07:21 +000053phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
54
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070055bindir = get_option('prefix') + '/' + get_option('bindir')
56
57deps = [
58 boost,
59 gpiodcxx,
60 sdbusplus,
Paul Fertser97b5ef22024-01-23 10:07:21 +000061 phosphor_dbus_interfaces,
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070062]
63
64if(get_option('libpeci').enabled())
65 peci = dependency('libpeci')
66 deps += [
67 peci,
68 ]
69endif
70
Jason M. Billsd6087ae2023-10-09 11:54:13 -070071incs = include_directories('include')
72
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070073executable(
74 'host-error-monitor',
75 'src/host_error_monitor.cpp',
Jason M. Billsd6087ae2023-10-09 11:54:13 -070076 include_directories: incs,
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070077 dependencies: deps,
78 install: true,
79 install_dir: bindir
80)
81
82subdir('service_files')
Jason M. Billsd6087ae2023-10-09 11:54:13 -070083
Jason M. Bills7aede382024-04-01 11:44:08 -070084if get_option('tests').allowed()
Jason M. Billsd6087ae2023-10-09 11:54:13 -070085 subdir('tests')
86endif