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 | fd1c3f1 | 2023-07-12 11:15:27 -0500 | [diff] [blame] | 5 | meson_version: '>=1.1.1', |
William A. Kennington III | 147b1fd | 2021-07-29 14:00:31 -0700 | [diff] [blame] | 6 | default_options: [ |
| 7 | 'werror=true', |
| 8 | 'warning_level=3', |
Patrick Williams | fd1c3f1 | 2023-07-12 11:15:27 -0500 | [diff] [blame] | 9 | 'cpp_std=c++23', |
William A. Kennington III | 147b1fd | 2021-07-29 14:00:31 -0700 | [diff] [blame] | 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'), |
Konstantin Aladyshev | 3db1189 | 2024-03-29 16:36:24 +0300 | [diff] [blame] | 17 | dependency('boost'), |
William A. Kennington III | 147b1fd | 2021-07-29 14:00:31 -0700 | [diff] [blame] | 18 | ] |
| 19 | |
| 20 | if get_option('log-threshold') |
| 21 | cpp_args += '-DSEL_LOGGER_MONITOR_THRESHOLD_EVENTS' |
| 22 | endif |
| 23 | if get_option('log-pulse') |
| 24 | cpp_args += '-DREDFISH_LOG_MONITOR_PULSE_EVENTS' |
| 25 | endif |
| 26 | if get_option('log-watchdog') |
| 27 | cpp_args += '-DSEL_LOGGER_MONITOR_WATCHDOG_EVENTS' |
| 28 | endif |
| 29 | if get_option('log-alarm') |
| 30 | cpp_args += '-DSEL_LOGGER_MONITOR_THRESHOLD_ALARM_EVENTS' |
| 31 | endif |
JinFuLin | 7c2810b | 2022-12-02 13:55:28 +0800 | [diff] [blame] | 32 | if get_option('log-host') |
| 33 | cpp_args += '-DSEL_LOGGER_MONITOR_HOST_ERROR_EVENTS' |
| 34 | endif |
William A. Kennington III | 147b1fd | 2021-07-29 14:00:31 -0700 | [diff] [blame] | 35 | if get_option('send-to-logger') |
| 36 | cpp_args += '-DSEL_LOGGER_SEND_TO_LOGGING_SERVICE' |
| 37 | |
Patrick Williams | 38d32a3 | 2022-03-21 11:27:45 -0500 | [diff] [blame] | 38 | deps += dependency('phosphor-logging') |
William A. Kennington III | 147b1fd | 2021-07-29 14:00:31 -0700 | [diff] [blame] | 39 | endif |
Jonico Eustaquio | 9fa224c | 2024-01-10 13:08:52 -0600 | [diff] [blame^] | 40 | if get_option('sel-delete') |
| 41 | cpp_args += '-DSEL_LOGGER_ENABLE_SEL_DELETE' |
| 42 | endif |
William A. Kennington III | 147b1fd | 2021-07-29 14:00:31 -0700 | [diff] [blame] | 43 | |
| 44 | executable( |
| 45 | 'sel-logger', |
| 46 | 'src/sel_logger.cpp', |
| 47 | include_directories: include_directories('include'), |
| 48 | implicit_include_directories: false, |
| 49 | cpp_args: cpp_args, |
| 50 | dependencies: deps, |
| 51 | install: true, |
| 52 | install_dir: get_option('bindir')) |
| 53 | |
| 54 | systemd = dependency('systemd') |
| 55 | if systemd.found() |
| 56 | install_data( |
| 57 | 'service_files/xyz.openbmc_project.Logging.IPMI.service', |
Patrick Williams | 9b2f8db | 2023-04-12 08:01:05 -0500 | [diff] [blame] | 58 | install_dir: systemd.get_variable('systemdsystemunitdir')) |
William A. Kennington III | 147b1fd | 2021-07-29 14:00:31 -0700 | [diff] [blame] | 59 | endif |