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