blob: 64a2b866a28abba9dbb73cc38640f950d04a087f [file] [log] [blame]
George Liuc0fd1f82022-06-21 16:12:55 +08001templates_depends = files(
2 'example/example.yaml',
3 'example/test.yaml',
4 'templates/callbackgroup.mako.cpp',
5 'templates/conditional.mako.cpp',
6 'templates/count.mako.cpp',
7 'templates/median.mako.cpp',
8 'templates/generated.mako.hpp',
9 'templates/journal.mako.cpp',
10 'templates/elog.mako.cpp',
11 'templates/errors.mako.hpp',
12 'templates/method.mako.cpp',
13 'templates/resolve_errors.mako.cpp',
14 'templates/event.mako.cpp',
15)
16
George Liu8246da02022-06-25 08:46:55 +080017yamldir = get_option('YAML_PATH')
18if yamldir == ''
19 yamldir = meson.project_source_root() + '/src/example'
20endif
21
George Liuc0fd1f82022-06-21 16:12:55 +080022generated_hpp = custom_target(
23 'generated.hpp',
24 command: [
25 prog_python,
26 meson.project_source_root() + '/src/pdmgen.py',
27 '-t', 'generated.mako.hpp',
28 '-p', meson.project_source_root() + '/src/templates',
George Liu8246da02022-06-25 08:46:55 +080029 '-d', yamldir,
George Liuc0fd1f82022-06-21 16:12:55 +080030 '-o', meson.current_build_dir() + '/generated.hpp',
31 'generate-cpp'
32 ],
33 depend_files: templates_depends,
34 output: 'generated.hpp',
35)
36
37sources = [
38 generated_hpp,
39 'elog.cpp',
40 'event_manager.cpp',
41 'event_serialize.cpp',
42 'journal.cpp',
43 'main.cpp',
44 'pathwatch.cpp',
45 'propertywatch.cpp',
46 'resolve_errors.cpp',
47 'snmp_trap.cpp',
48]
49
50deps = [
51 sdbusplus_dep,
52 sdeventplus_dep,
53 phosphor_dbus_interfaces_dep,
54 phosphor_logging_dep,
55 phosphor_snmp_dep,
56]
57
58executable(
59 'phosphor-dbus-monitor',
60 sources,
61 include_directories: ['..'],
62 implicit_include_directories: true,
63 dependencies: deps,
64 install: true,
65 install_dir: get_option('bindir'),
66)
George Liu7efd6f32022-06-22 10:42:56 +080067
68build_tests = get_option('tests')
69if not build_tests.disabled()
70 subdir('test')
71endif