| 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 |  | 
|  | 33 | boost = dependency('boost', version: '>=1.82') | 
|  | 34 | add_project_arguments( | 
|  | 35 | [ | 
|  | 36 | '-DBOOST_ASIO_DISABLE_THREADS', | 
|  | 37 | '-DBOOST_ASIO_EXCEPTION_DISABLE', | 
|  | 38 | '-DBOOST_ASIO_NO_DEPRECATED', | 
|  | 39 | '-DBOOST_NO_RTTI', | 
|  | 40 | '-DBOOST_NO_TYPEID', | 
|  | 41 | ], | 
|  | 42 | language : 'cpp' | 
|  | 43 | ) | 
|  | 44 |  | 
|  | 45 | bindir = get_option('prefix') + '/' + get_option('bindir') | 
|  | 46 |  | 
|  | 47 | deps = [ | 
|  | 48 | boost, | 
|  | 49 | gpiodcxx, | 
|  | 50 | sdbusplus, | 
|  | 51 | ] | 
|  | 52 |  | 
|  | 53 | if(get_option('libpeci').enabled()) | 
|  | 54 | peci = dependency('libpeci') | 
|  | 55 | deps += [ | 
|  | 56 | peci, | 
|  | 57 | ] | 
|  | 58 | endif | 
|  | 59 |  | 
|  | 60 | executable( | 
|  | 61 | 'host-error-monitor', | 
|  | 62 | 'src/host_error_monitor.cpp', | 
|  | 63 | include_directories: include_directories('include'), | 
|  | 64 | dependencies: deps, | 
|  | 65 | install: true, | 
|  | 66 | install_dir: bindir | 
|  | 67 | ) | 
|  | 68 |  | 
|  | 69 | subdir('service_files') |