blob: 1c42cafe38c27e166f68c472bcae3a092af2d435 [file] [log] [blame]
Jason M. Bills5e1e7e32023-08-03 13:42:18 -07001project(
2 'host-error-monitor',
3 'cpp',
Jason M. Bills28836072024-05-17 12:47:15 -07004 version: '1.0',
Jason M. Bills5e1e7e32023-08-03 13:42:18 -07005 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',
Jason M. Bills28836072024-05-17 12:47:15 -070012 ],
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070013)
14
Jason M. Bills28836072024-05-17 12:47:15 -070015if (get_option('libpeci').enabled())
16 add_project_arguments('-DLIBPECI', language: 'cpp')
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070017endif
18
Jason M. Bills28836072024-05-17 12:47:15 -070019if (get_option('crashdump').enabled())
20 add_project_arguments('-DCRASHDUMP', language: 'cpp')
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070021endif
22
Jason M. Bills28836072024-05-17 12:47:15 -070023if (get_option('send-to-logger').enabled())
24 add_project_arguments('-DSEND_TO_LOGGING_SERVICE', language: 'cpp')
Paul Fertser97b5ef22024-01-23 10:07:21 +000025endif
26
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070027sdbusplus = dependency('sdbusplus')
Jason M. Bills28836072024-05-17 12:47:15 -070028gpiodcxx = dependency(
29 'libgpiodcxx',
30 default_options: ['bindings=cxx'],
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070031)
32
33systemd = dependency('systemd', required: true)
Jason M. Bills28836072024-05-17 12:47:15 -070034systemd_system_unit_dir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir')
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070035
Jason M. Bills28836072024-05-17 12:47:15 -070036boost = dependency('boost', version: '>=1.82.0', required: false, include_type: 'system')
Jason M. Bills1b7e5602023-10-03 14:42:23 -070037if not boost.found()
38 boost = subproject('boost', required: true).get_variable('boost_dep')
39 boost = boost.as_system('system')
40endif
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070041add_project_arguments(
42 [
43 '-DBOOST_ASIO_DISABLE_THREADS',
44 '-DBOOST_ASIO_EXCEPTION_DISABLE',
45 '-DBOOST_ASIO_NO_DEPRECATED',
46 '-DBOOST_NO_RTTI',
47 '-DBOOST_NO_TYPEID',
48 ],
Jason M. Bills28836072024-05-17 12:47:15 -070049 language: 'cpp',
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070050)
51
Paul Fertser97b5ef22024-01-23 10:07:21 +000052phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
53
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070054bindir = get_option('prefix') + '/' + get_option('bindir')
55
56deps = [
57 boost,
58 gpiodcxx,
59 sdbusplus,
Paul Fertser97b5ef22024-01-23 10:07:21 +000060 phosphor_dbus_interfaces,
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070061]
62
Jason M. Bills28836072024-05-17 12:47:15 -070063if (get_option('libpeci').enabled())
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070064 peci = dependency('libpeci')
65 deps += [
66 peci,
67 ]
68endif
69
Jason M. Billsd6087ae2023-10-09 11:54:13 -070070incs = include_directories('include')
71
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070072executable(
73 'host-error-monitor',
74 'src/host_error_monitor.cpp',
Jason M. Billsd6087ae2023-10-09 11:54:13 -070075 include_directories: incs,
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070076 dependencies: deps,
77 install: true,
Jason M. Bills28836072024-05-17 12:47:15 -070078 install_dir: bindir,
Jason M. Bills5e1e7e32023-08-03 13:42:18 -070079)
80
81subdir('service_files')
Jason M. Billsd6087ae2023-10-09 11:54:13 -070082
Jason M. Bills7aede382024-04-01 11:44:08 -070083if get_option('tests').allowed()
Jason M. Bills28836072024-05-17 12:47:15 -070084 subdir('tests')
85endif