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 | |
| 23 | sdbusplus = dependency('sdbusplus') |
| 24 | gpiodcxx = dependency('libgpiodcxx', |
| 25 | default_options: ['bindings=cxx'], |
| 26 | ) |
| 27 | |
| 28 | systemd = dependency('systemd', required: true) |
| 29 | systemd_system_unit_dir = systemd.get_variable(pkgconfig: |
| 30 | 'systemdsystemunitdir' |
| 31 | ) |
| 32 | |
Jason M. Bills | 1b7e560 | 2023-10-03 14:42:23 -0700 | [diff] [blame] | 33 | boost = dependency('boost', version : '>=1.82.0', required : false, include_type: 'system') |
| 34 | if not boost.found() |
| 35 | boost = subproject('boost', required: true).get_variable('boost_dep') |
| 36 | boost = boost.as_system('system') |
| 37 | endif |
Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 38 | add_project_arguments( |
| 39 | [ |
| 40 | '-DBOOST_ASIO_DISABLE_THREADS', |
| 41 | '-DBOOST_ASIO_EXCEPTION_DISABLE', |
| 42 | '-DBOOST_ASIO_NO_DEPRECATED', |
| 43 | '-DBOOST_NO_RTTI', |
| 44 | '-DBOOST_NO_TYPEID', |
| 45 | ], |
| 46 | language : 'cpp' |
| 47 | ) |
| 48 | |
| 49 | bindir = get_option('prefix') + '/' + get_option('bindir') |
| 50 | |
| 51 | deps = [ |
| 52 | boost, |
| 53 | gpiodcxx, |
| 54 | sdbusplus, |
| 55 | ] |
| 56 | |
| 57 | if(get_option('libpeci').enabled()) |
| 58 | peci = dependency('libpeci') |
| 59 | deps += [ |
| 60 | peci, |
| 61 | ] |
| 62 | endif |
| 63 | |
Jason M. Bills | d6087ae | 2023-10-09 11:54:13 -0700 | [diff] [blame^] | 64 | incs = include_directories('include') |
| 65 | |
Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 66 | executable( |
| 67 | 'host-error-monitor', |
| 68 | 'src/host_error_monitor.cpp', |
Jason M. Bills | d6087ae | 2023-10-09 11:54:13 -0700 | [diff] [blame^] | 69 | include_directories: incs, |
Jason M. Bills | 5e1e7e3 | 2023-08-03 13:42:18 -0700 | [diff] [blame] | 70 | dependencies: deps, |
| 71 | install: true, |
| 72 | install_dir: bindir |
| 73 | ) |
| 74 | |
| 75 | subdir('service_files') |
Jason M. Bills | d6087ae | 2023-10-09 11:54:13 -0700 | [diff] [blame^] | 76 | |
| 77 | if get_option('tests').enabled() |
| 78 | subdir('tests') |
| 79 | endif |