blob: 9c8b0d5e215305f87630b91104ba58f061c82c84 [file] [log] [blame]
George Liuc0fd1f82022-06-21 16:12:55 +08001project(
2 'phosphor-dbus-monitor', 'cpp',
3 version : '1.0.0',
Patrick Williams5875d562023-07-12 11:15:16 -05004 meson_version: '>=1.1.1',
George Liuc0fd1f82022-06-21 16:12:55 +08005 default_options: [
6 'warning_level=3',
7 'werror=true',
Patrick Williams5875d562023-07-12 11:15:16 -05008 'cpp_std=c++23',
George Liuc0fd1f82022-06-21 16:12:55 +08009 'buildtype=debugoptimized',
10 ]
11)
12
13conf_data = configuration_data()
14conf_data.set_quoted('OBJ_EVENT', '/xyz/openbmc_project/events')
15conf_data.set_quoted('BUSNAME_EVENT', 'xyz.openbmc_project.Events')
16conf_data.set_quoted('EVENTS_PERSIST_PATH', '/var/lib/phosphor-dbus-monitor/events')
17
18conf_data.set('CLASS_VERSION', 1)
19conf_data.set('MAX_EVENTS', 20)
20
Konstantin Aladyshevcd1e72a2024-10-10 17:22:19 +030021cpp = meson.get_compiler('cpp')
22# Get Cereal dependency.
23cereal_dep = dependency('cereal', required: false)
24has_cereal = cpp.has_header_symbol(
25 'cereal/cereal.hpp',
26 'cereal::specialize',
27 dependencies: cereal_dep,
28 required: false)
29if 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')
38endif
39
40sdbusplus_dep = dependency('sdbusplus', required : false)
George Liuc0fd1f82022-06-21 16:12:55 +080041sdeventplus_dep = dependency('sdeventplus')
42phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
43phosphor_logging_dep = dependency('phosphor-logging')
44phosphor_snmp_dep = dependency('phosphor-snmp')
45
Konstantin Aladyshevcd1e72a2024-10-10 17:22:19 +030046sdbusplus_python_env = {}
47if 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'}
51endif
52
George Liuc0fd1f82022-06-21 16:12:55 +080053prog_python = find_program('python3', required: true)
54realpath_prog = find_program('realpath')
55
56configure_file(output: 'config.h',
57 configuration: conf_data
58)
59
60subdir('src')
61subdir('mslverify')