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', |
Patrick Williams | 9b2f8db | 2023-04-12 08:01:05 -0500 | [diff] [blame^] | 5 | meson_version: '>=0.58.0', |
William A. Kennington III | 147b1fd | 2021-07-29 14:00:31 -0700 | [diff] [blame] | 6 | default_options: [ |
| 7 | 'werror=true', |
| 8 | 'warning_level=3', |
| 9 | 'cpp_std=c++20', |
| 10 | ]) |
| 11 | |
| 12 | cpp_args = [] |
| 13 | |
| 14 | deps = [ |
Patrick Williams | 38d32a3 | 2022-03-21 11:27:45 -0500 | [diff] [blame] | 15 | dependency('sdbusplus'), |
William A. Kennington III | 147b1fd | 2021-07-29 14:00:31 -0700 | [diff] [blame] | 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 |
JinFuLin | 7c2810b | 2022-12-02 13:55:28 +0800 | [diff] [blame] | 31 | if get_option('log-host') |
| 32 | cpp_args += '-DSEL_LOGGER_MONITOR_HOST_ERROR_EVENTS' |
| 33 | endif |
William A. Kennington III | 147b1fd | 2021-07-29 14:00:31 -0700 | [diff] [blame] | 34 | if get_option('send-to-logger') |
| 35 | cpp_args += '-DSEL_LOGGER_SEND_TO_LOGGING_SERVICE' |
| 36 | |
Patrick Williams | 38d32a3 | 2022-03-21 11:27:45 -0500 | [diff] [blame] | 37 | deps += dependency('phosphor-logging') |
William A. Kennington III | 147b1fd | 2021-07-29 14:00:31 -0700 | [diff] [blame] | 38 | endif |
Charles Boyer | 9f476e8 | 2021-07-29 16:33:01 -0500 | [diff] [blame] | 39 | if get_option('clears-sel') |
| 40 | cpp_args += '-DSEL_LOGGER_CLEARS_SEL' |
| 41 | endif |
William A. Kennington III | 147b1fd | 2021-07-29 14:00:31 -0700 | [diff] [blame] | 42 | |
| 43 | executable( |
| 44 | 'sel-logger', |
| 45 | 'src/sel_logger.cpp', |
| 46 | include_directories: include_directories('include'), |
| 47 | implicit_include_directories: false, |
| 48 | cpp_args: cpp_args, |
| 49 | dependencies: deps, |
| 50 | install: true, |
| 51 | install_dir: get_option('bindir')) |
| 52 | |
| 53 | systemd = dependency('systemd') |
| 54 | if systemd.found() |
| 55 | install_data( |
| 56 | 'service_files/xyz.openbmc_project.Logging.IPMI.service', |
Patrick Williams | 9b2f8db | 2023-04-12 08:01:05 -0500 | [diff] [blame^] | 57 | install_dir: systemd.get_variable('systemdsystemunitdir')) |
William A. Kennington III | 147b1fd | 2021-07-29 14:00:31 -0700 | [diff] [blame] | 58 | endif |