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