Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 1 | project( |
| 2 | 'host-error-monitor', |
| 3 | 'cpp', |
Jason M. Bills | 2883607 | 2024-05-17 12:47:15 -0700 | [diff] [blame] | 4 | version: '1.0', |
Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 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', |
Jason M. Bills | 2883607 | 2024-05-17 12:47:15 -0700 | [diff] [blame] | 12 | ], |
Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 13 | ) |
| 14 | |
Jason M. Bills | 2883607 | 2024-05-17 12:47:15 -0700 | [diff] [blame] | 15 | if (get_option('libpeci').enabled()) |
| 16 | add_project_arguments('-DLIBPECI', language: 'cpp') |
Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 17 | endif |
| 18 | |
Jason M. Bills | 2883607 | 2024-05-17 12:47:15 -0700 | [diff] [blame] | 19 | if (get_option('crashdump').enabled()) |
| 20 | add_project_arguments('-DCRASHDUMP', language: 'cpp') |
Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 21 | endif |
| 22 | |
Jason M. Bills | 2883607 | 2024-05-17 12:47:15 -0700 | [diff] [blame] | 23 | if (get_option('send-to-logger').enabled()) |
| 24 | add_project_arguments('-DSEND_TO_LOGGING_SERVICE', language: 'cpp') |
Paul Fertser | 97b5ef2 | 2024-01-23 10:07:21 +0000 | [diff] [blame] | 25 | endif |
| 26 | |
Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 27 | sdbusplus = dependency('sdbusplus') |
Jason M. Bills | 2883607 | 2024-05-17 12:47:15 -0700 | [diff] [blame] | 28 | gpiodcxx = dependency( |
| 29 | 'libgpiodcxx', |
| 30 | default_options: ['bindings=cxx'], |
Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 31 | ) |
| 32 | |
| 33 | systemd = dependency('systemd', required: true) |
Jason M. Bills | 2883607 | 2024-05-17 12:47:15 -0700 | [diff] [blame] | 34 | systemd_system_unit_dir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir') |
Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 35 | |
Jason M. Bills | 2883607 | 2024-05-17 12:47:15 -0700 | [diff] [blame] | 36 | boost = dependency('boost', version: '>=1.82.0', required: false, include_type: 'system') |
Jason M. Bills | 1b7e560 | 2023-10-03 14:42:23 -0700 | [diff] [blame] | 37 | if not boost.found() |
| 38 | boost = subproject('boost', required: true).get_variable('boost_dep') |
| 39 | boost = boost.as_system('system') |
| 40 | endif |
Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 41 | add_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. Bills | 2883607 | 2024-05-17 12:47:15 -0700 | [diff] [blame] | 49 | language: 'cpp', |
Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 50 | ) |
| 51 | |
Paul Fertser | 97b5ef2 | 2024-01-23 10:07:21 +0000 | [diff] [blame] | 52 | phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces') |
| 53 | |
Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 54 | bindir = get_option('prefix') + '/' + get_option('bindir') |
| 55 | |
| 56 | deps = [ |
| 57 | boost, |
| 58 | gpiodcxx, |
| 59 | sdbusplus, |
Paul Fertser | 97b5ef2 | 2024-01-23 10:07:21 +0000 | [diff] [blame] | 60 | phosphor_dbus_interfaces, |
Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 61 | ] |
| 62 | |
Jason M. Bills | 2883607 | 2024-05-17 12:47:15 -0700 | [diff] [blame] | 63 | if (get_option('libpeci').enabled()) |
Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 64 | peci = dependency('libpeci') |
| 65 | deps += [ |
| 66 | peci, |
| 67 | ] |
| 68 | endif |
| 69 | |
Jason M. Bills | d6087ae | 2023-10-09 11:54:13 -0700 | [diff] [blame] | 70 | incs = include_directories('include') |
| 71 | |
Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 72 | executable( |
| 73 | 'host-error-monitor', |
| 74 | 'src/host_error_monitor.cpp', |
Jason M. Bills | d6087ae | 2023-10-09 11:54:13 -0700 | [diff] [blame] | 75 | include_directories: incs, |
Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 76 | dependencies: deps, |
| 77 | install: true, |
Jason M. Bills | 2883607 | 2024-05-17 12:47:15 -0700 | [diff] [blame] | 78 | install_dir: bindir, |
Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 79 | ) |
| 80 | |
| 81 | subdir('service_files') |
Jason M. Bills | d6087ae | 2023-10-09 11:54:13 -0700 | [diff] [blame] | 82 | |
Jason M. Bills | 7aede38 | 2024-04-01 11:44:08 -0700 | [diff] [blame] | 83 | if get_option('tests').allowed() |
Jason M. Bills | 2883607 | 2024-05-17 12:47:15 -0700 | [diff] [blame] | 84 | subdir('tests') |
| 85 | endif |