blob: a94cb4bb603a1a273747554ff9a5d8633ac54dad [file] [log] [blame]
William A. Kennington III147b1fd2021-07-29 14:00:31 -07001project(
Patrick Williams6e696122025-02-01 08:37:01 -05002 'phosphor-sel-logger',
3 'cpp',
4 version: '0.1',
5 meson_version: '>=1.1.1',
6 default_options: ['werror=true', 'warning_level=3', 'cpp_std=c++23'],
7)
William A. Kennington III147b1fd2021-07-29 14:00:31 -07008
9cpp_args = []
10
Patrick Williams6e696122025-02-01 08:37:01 -050011deps = [dependency('sdbusplus'), dependency('libsystemd'), dependency('boost')]
William A. Kennington III147b1fd2021-07-29 14:00:31 -070012
13if get_option('log-threshold')
Patrick Williams6e696122025-02-01 08:37:01 -050014 cpp_args += '-DSEL_LOGGER_MONITOR_THRESHOLD_EVENTS'
William A. Kennington III147b1fd2021-07-29 14:00:31 -070015endif
16if get_option('log-pulse')
Patrick Williams6e696122025-02-01 08:37:01 -050017 cpp_args += '-DREDFISH_LOG_MONITOR_PULSE_EVENTS'
William A. Kennington III147b1fd2021-07-29 14:00:31 -070018endif
19if get_option('log-watchdog')
Patrick Williams6e696122025-02-01 08:37:01 -050020 cpp_args += '-DSEL_LOGGER_MONITOR_WATCHDOG_EVENTS'
William A. Kennington III147b1fd2021-07-29 14:00:31 -070021endif
22if get_option('log-alarm')
Patrick Williams6e696122025-02-01 08:37:01 -050023 cpp_args += '-DSEL_LOGGER_MONITOR_THRESHOLD_ALARM_EVENTS'
William A. Kennington III147b1fd2021-07-29 14:00:31 -070024endif
JinFuLin7c2810b2022-12-02 13:55:28 +080025if get_option('log-host')
Patrick Williams6e696122025-02-01 08:37:01 -050026 cpp_args += '-DSEL_LOGGER_MONITOR_HOST_ERROR_EVENTS'
JinFuLin7c2810b2022-12-02 13:55:28 +080027endif
William A. Kennington III147b1fd2021-07-29 14:00:31 -070028if get_option('send-to-logger')
Patrick Williams6e696122025-02-01 08:37:01 -050029 cpp_args += '-DSEL_LOGGER_SEND_TO_LOGGING_SERVICE'
William A. Kennington III147b1fd2021-07-29 14:00:31 -070030
Patrick Williams6e696122025-02-01 08:37:01 -050031 deps += dependency('phosphor-logging')
William A. Kennington III147b1fd2021-07-29 14:00:31 -070032endif
Jonico Eustaquio9fa224c2024-01-10 13:08:52 -060033if get_option('sel-delete')
Patrick Williams6e696122025-02-01 08:37:01 -050034 cpp_args += '-DSEL_LOGGER_ENABLE_SEL_DELETE'
Jonico Eustaquio9c495c62024-07-02 16:35:14 -050035
Patrick Williams6e696122025-02-01 08:37:01 -050036 deps += dependency('phosphor-dbus-interfaces')
Jonico Eustaquio9fa224c2024-01-10 13:08:52 -060037endif
William A. Kennington III147b1fd2021-07-29 14:00:31 -070038
39executable(
Patrick Williams6e696122025-02-01 08:37:01 -050040 '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)
William A. Kennington III147b1fd2021-07-29 14:00:31 -070049
50systemd = dependency('systemd')
51if systemd.found()
Patrick Williams6e696122025-02-01 08:37:01 -050052 install_data(
53 'service_files/xyz.openbmc_project.Logging.IPMI.service',
54 install_dir: systemd.get_variable('systemdsystemunitdir'),
55 )
William A. Kennington III147b1fd2021-07-29 14:00:31 -070056endif