George Liu | c0fd1f8 | 2022-06-21 16:12:55 +0800 | [diff] [blame] | 1 | project( |
Patrick Williams | 9c2f94e | 2025-02-01 08:36:38 -0500 | [diff] [blame^] | 2 | 'phosphor-dbus-monitor', |
| 3 | 'cpp', |
| 4 | version: '1.0.0', |
Patrick Williams | 5875d56 | 2023-07-12 11:15:16 -0500 | [diff] [blame] | 5 | meson_version: '>=1.1.1', |
George Liu | c0fd1f8 | 2022-06-21 16:12:55 +0800 | [diff] [blame] | 6 | default_options: [ |
| 7 | 'warning_level=3', |
| 8 | 'werror=true', |
Patrick Williams | 5875d56 | 2023-07-12 11:15:16 -0500 | [diff] [blame] | 9 | 'cpp_std=c++23', |
George Liu | c0fd1f8 | 2022-06-21 16:12:55 +0800 | [diff] [blame] | 10 | 'buildtype=debugoptimized', |
Patrick Williams | 9c2f94e | 2025-02-01 08:36:38 -0500 | [diff] [blame^] | 11 | ], |
George Liu | c0fd1f8 | 2022-06-21 16:12:55 +0800 | [diff] [blame] | 12 | ) |
| 13 | |
| 14 | conf_data = configuration_data() |
| 15 | conf_data.set_quoted('OBJ_EVENT', '/xyz/openbmc_project/events') |
| 16 | conf_data.set_quoted('BUSNAME_EVENT', 'xyz.openbmc_project.Events') |
Patrick Williams | 9c2f94e | 2025-02-01 08:36:38 -0500 | [diff] [blame^] | 17 | conf_data.set_quoted( |
| 18 | 'EVENTS_PERSIST_PATH', |
| 19 | '/var/lib/phosphor-dbus-monitor/events', |
| 20 | ) |
George Liu | c0fd1f8 | 2022-06-21 16:12:55 +0800 | [diff] [blame] | 21 | |
| 22 | conf_data.set('CLASS_VERSION', 1) |
| 23 | conf_data.set('MAX_EVENTS', 20) |
| 24 | |
Konstantin Aladyshev | cd1e72a | 2024-10-10 17:22:19 +0300 | [diff] [blame] | 25 | cpp = meson.get_compiler('cpp') |
| 26 | # Get Cereal dependency. |
| 27 | cereal_dep = dependency('cereal', required: false) |
| 28 | has_cereal = cpp.has_header_symbol( |
| 29 | 'cereal/cereal.hpp', |
| 30 | 'cereal::specialize', |
| 31 | dependencies: cereal_dep, |
Patrick Williams | 9c2f94e | 2025-02-01 08:36:38 -0500 | [diff] [blame^] | 32 | required: false, |
| 33 | ) |
Konstantin Aladyshev | cd1e72a | 2024-10-10 17:22:19 +0300 | [diff] [blame] | 34 | if not has_cereal |
| 35 | cereal_opts = import('cmake').subproject_options() |
Patrick Williams | 9c2f94e | 2025-02-01 08:36:38 -0500 | [diff] [blame^] | 36 | cereal_opts.add_cmake_defines( |
| 37 | {'BUILD_TESTS': 'OFF', 'SKIP_PERFORMANCE_COMPARISON': 'ON'}, |
| 38 | ) |
Konstantin Aladyshev | cd1e72a | 2024-10-10 17:22:19 +0300 | [diff] [blame] | 39 | cereal_proj = import('cmake').subproject( |
| 40 | 'cereal', |
| 41 | options: cereal_opts, |
Patrick Williams | 9c2f94e | 2025-02-01 08:36:38 -0500 | [diff] [blame^] | 42 | required: false, |
| 43 | ) |
Konstantin Aladyshev | cd1e72a | 2024-10-10 17:22:19 +0300 | [diff] [blame] | 44 | assert(cereal_proj.found(), 'cereal is required') |
| 45 | cereal_dep = cereal_proj.dependency('cereal') |
| 46 | endif |
| 47 | |
Patrick Williams | 9c2f94e | 2025-02-01 08:36:38 -0500 | [diff] [blame^] | 48 | sdbusplus_dep = dependency('sdbusplus', required: false) |
George Liu | c0fd1f8 | 2022-06-21 16:12:55 +0800 | [diff] [blame] | 49 | sdeventplus_dep = dependency('sdeventplus') |
| 50 | phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces') |
| 51 | phosphor_logging_dep = dependency('phosphor-logging') |
| 52 | phosphor_snmp_dep = dependency('phosphor-snmp') |
| 53 | |
Konstantin Aladyshev | cd1e72a | 2024-10-10 17:22:19 +0300 | [diff] [blame] | 54 | sdbusplus_python_env = {} |
| 55 | if not sdbusplus_dep.found() |
| 56 | sdbusplus_proj = subproject('sdbusplus') |
| 57 | sdbusplus_dep = sdbusplus_proj.get_variable('sdbusplus_dep') |
Patrick Williams | 9c2f94e | 2025-02-01 08:36:38 -0500 | [diff] [blame^] | 58 | sdbusplus_python_env = { |
| 59 | 'PYTHONPATH': meson.current_source_dir() / 'subprojects' / 'sdbusplus' / 'tools', |
| 60 | } |
Konstantin Aladyshev | cd1e72a | 2024-10-10 17:22:19 +0300 | [diff] [blame] | 61 | endif |
| 62 | |
George Liu | c0fd1f8 | 2022-06-21 16:12:55 +0800 | [diff] [blame] | 63 | prog_python = find_program('python3', required: true) |
| 64 | realpath_prog = find_program('realpath') |
| 65 | |
Patrick Williams | 9c2f94e | 2025-02-01 08:36:38 -0500 | [diff] [blame^] | 66 | configure_file(output: 'config.h', configuration: conf_data) |
George Liu | c0fd1f8 | 2022-06-21 16:12:55 +0800 | [diff] [blame] | 67 | |
| 68 | subdir('src') |
| 69 | subdir('mslverify') |