William A. Kennington III | 147b1fd | 2021-07-29 14:00:31 -0700 | [diff] [blame^] | 1 | project( |
| 2 | 'phosphor-sel-logger', |
| 3 | 'cpp', |
| 4 | version: '0.1', |
| 5 | meson_version: '>=0.57.0', |
| 6 | default_options: [ |
| 7 | 'werror=true', |
| 8 | 'warning_level=3', |
| 9 | 'cpp_std=c++20', |
| 10 | ]) |
| 11 | |
| 12 | cpp_args = [] |
| 13 | |
| 14 | deps = [ |
| 15 | dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']), |
| 16 | dependency('systemd'), |
| 17 | ] |
| 18 | |
| 19 | if get_option('log-threshold') |
| 20 | cpp_args += '-DSEL_LOGGER_MONITOR_THRESHOLD_EVENTS' |
| 21 | endif |
| 22 | if get_option('log-pulse') |
| 23 | cpp_args += '-DREDFISH_LOG_MONITOR_PULSE_EVENTS' |
| 24 | endif |
| 25 | if get_option('log-watchdog') |
| 26 | cpp_args += '-DSEL_LOGGER_MONITOR_WATCHDOG_EVENTS' |
| 27 | endif |
| 28 | if get_option('log-alarm') |
| 29 | cpp_args += '-DSEL_LOGGER_MONITOR_THRESHOLD_ALARM_EVENTS' |
| 30 | endif |
| 31 | if get_option('send-to-logger') |
| 32 | cpp_args += '-DSEL_LOGGER_SEND_TO_LOGGING_SERVICE' |
| 33 | |
| 34 | deps += dependency( |
| 35 | 'phosphor-logging', |
| 36 | fallback: ['phosphor-logging', 'phosphor_logging_dep']) |
| 37 | endif |
| 38 | |
| 39 | executable( |
| 40 | 'sel-logger', |
| 41 | 'src/sel_logger.cpp', |
| 42 | include_directories: include_directories('include'), |
| 43 | implicit_include_directories: false, |
| 44 | cpp_args: cpp_args, |
| 45 | dependencies: deps, |
| 46 | install: true, |
| 47 | install_dir: get_option('bindir')) |
| 48 | |
| 49 | systemd = dependency('systemd') |
| 50 | if systemd.found() |
| 51 | install_data( |
| 52 | 'service_files/xyz.openbmc_project.Logging.IPMI.service', |
| 53 | install_dir: systemd.get_variable(pkgconfig: 'systemdsystemunitdir')) |
| 54 | endif |