blob: 9512eda39f30a5b6e8d0cb2201c9528af0a8e2da [file] [log] [blame]
George Liuc0fd1f82022-06-21 16:12:55 +08001project(
Patrick Williams9c2f94e2025-02-01 08:36:38 -05002 'phosphor-dbus-monitor',
3 'cpp',
4 version: '1.0.0',
Patrick Williams5875d562023-07-12 11:15:16 -05005 meson_version: '>=1.1.1',
George Liuc0fd1f82022-06-21 16:12:55 +08006 default_options: [
7 'warning_level=3',
8 'werror=true',
Patrick Williams5875d562023-07-12 11:15:16 -05009 'cpp_std=c++23',
George Liuc0fd1f82022-06-21 16:12:55 +080010 'buildtype=debugoptimized',
Patrick Williams9c2f94e2025-02-01 08:36:38 -050011 ],
George Liuc0fd1f82022-06-21 16:12:55 +080012)
13
14conf_data = configuration_data()
15conf_data.set_quoted('OBJ_EVENT', '/xyz/openbmc_project/events')
16conf_data.set_quoted('BUSNAME_EVENT', 'xyz.openbmc_project.Events')
Patrick Williams9c2f94e2025-02-01 08:36:38 -050017conf_data.set_quoted(
18 'EVENTS_PERSIST_PATH',
19 '/var/lib/phosphor-dbus-monitor/events',
20)
George Liuc0fd1f82022-06-21 16:12:55 +080021
22conf_data.set('CLASS_VERSION', 1)
23conf_data.set('MAX_EVENTS', 20)
24
Konstantin Aladyshevcd1e72a2024-10-10 17:22:19 +030025cpp = meson.get_compiler('cpp')
26# Get Cereal dependency.
27cereal_dep = dependency('cereal', required: false)
28has_cereal = cpp.has_header_symbol(
29 'cereal/cereal.hpp',
30 'cereal::specialize',
31 dependencies: cereal_dep,
Patrick Williams9c2f94e2025-02-01 08:36:38 -050032 required: false,
33)
Konstantin Aladyshevcd1e72a2024-10-10 17:22:19 +030034if not has_cereal
35 cereal_opts = import('cmake').subproject_options()
Patrick Williams9c2f94e2025-02-01 08:36:38 -050036 cereal_opts.add_cmake_defines(
37 {'BUILD_TESTS': 'OFF', 'SKIP_PERFORMANCE_COMPARISON': 'ON'},
38 )
Konstantin Aladyshevcd1e72a2024-10-10 17:22:19 +030039 cereal_proj = import('cmake').subproject(
40 'cereal',
41 options: cereal_opts,
Patrick Williams9c2f94e2025-02-01 08:36:38 -050042 required: false,
43 )
Konstantin Aladyshevcd1e72a2024-10-10 17:22:19 +030044 assert(cereal_proj.found(), 'cereal is required')
45 cereal_dep = cereal_proj.dependency('cereal')
46endif
47
Patrick Williams9c2f94e2025-02-01 08:36:38 -050048sdbusplus_dep = dependency('sdbusplus', required: false)
George Liuc0fd1f82022-06-21 16:12:55 +080049sdeventplus_dep = dependency('sdeventplus')
50phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
51phosphor_logging_dep = dependency('phosphor-logging')
52phosphor_snmp_dep = dependency('phosphor-snmp')
53
Konstantin Aladyshevcd1e72a2024-10-10 17:22:19 +030054sdbusplus_python_env = {}
55if not sdbusplus_dep.found()
56 sdbusplus_proj = subproject('sdbusplus')
57 sdbusplus_dep = sdbusplus_proj.get_variable('sdbusplus_dep')
Patrick Williams9c2f94e2025-02-01 08:36:38 -050058 sdbusplus_python_env = {
59 'PYTHONPATH': meson.current_source_dir() / 'subprojects' / 'sdbusplus' / 'tools',
60 }
Konstantin Aladyshevcd1e72a2024-10-10 17:22:19 +030061endif
62
George Liuc0fd1f82022-06-21 16:12:55 +080063prog_python = find_program('python3', required: true)
64realpath_prog = find_program('realpath')
65
Patrick Williams9c2f94e2025-02-01 08:36:38 -050066configure_file(output: 'config.h', configuration: conf_data)
George Liuc0fd1f82022-06-21 16:12:55 +080067
68subdir('src')
69subdir('mslverify')