George Liu | c0fd1f8 | 2022-06-21 16:12:55 +0800 | [diff] [blame] | 1 | templates_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 Liu | 8246da0 | 2022-06-25 08:46:55 +0800 | [diff] [blame] | 17 | yamldir = get_option('YAML_PATH') |
| 18 | if yamldir == '' |
| 19 | yamldir = meson.project_source_root() + '/src/example' |
| 20 | endif |
| 21 | |
George Liu | c0fd1f8 | 2022-06-21 16:12:55 +0800 | [diff] [blame] | 22 | generated_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 Liu | 8246da0 | 2022-06-25 08:46:55 +0800 | [diff] [blame] | 29 | '-d', yamldir, |
George Liu | c0fd1f8 | 2022-06-21 16:12:55 +0800 | [diff] [blame] | 30 | '-o', meson.current_build_dir() + '/generated.hpp', |
Matt Johnston | 04267b4 | 2022-08-04 15:05:11 +0800 | [diff] [blame] | 31 | '-e', meson.current_build_dir() + '/errors.hpp', |
George Liu | c0fd1f8 | 2022-06-21 16:12:55 +0800 | [diff] [blame] | 32 | 'generate-cpp' |
| 33 | ], |
| 34 | depend_files: templates_depends, |
Konstantin Aladyshev | cd1e72a | 2024-10-10 17:22:19 +0300 | [diff] [blame^] | 35 | env: sdbusplus_python_env, |
George Liu | c0fd1f8 | 2022-06-21 16:12:55 +0800 | [diff] [blame] | 36 | output: 'generated.hpp', |
| 37 | ) |
| 38 | |
| 39 | sources = [ |
| 40 | generated_hpp, |
| 41 | 'elog.cpp', |
| 42 | 'event_manager.cpp', |
| 43 | 'event_serialize.cpp', |
| 44 | 'journal.cpp', |
| 45 | 'main.cpp', |
| 46 | 'pathwatch.cpp', |
| 47 | 'propertywatch.cpp', |
| 48 | 'resolve_errors.cpp', |
| 49 | 'snmp_trap.cpp', |
| 50 | ] |
| 51 | |
| 52 | deps = [ |
Konstantin Aladyshev | cd1e72a | 2024-10-10 17:22:19 +0300 | [diff] [blame^] | 53 | cereal_dep, |
George Liu | c0fd1f8 | 2022-06-21 16:12:55 +0800 | [diff] [blame] | 54 | sdbusplus_dep, |
| 55 | sdeventplus_dep, |
| 56 | phosphor_dbus_interfaces_dep, |
| 57 | phosphor_logging_dep, |
| 58 | phosphor_snmp_dep, |
| 59 | ] |
| 60 | |
| 61 | executable( |
| 62 | 'phosphor-dbus-monitor', |
| 63 | sources, |
| 64 | include_directories: ['..'], |
| 65 | implicit_include_directories: true, |
| 66 | dependencies: deps, |
| 67 | install: true, |
| 68 | install_dir: get_option('bindir'), |
| 69 | ) |
George Liu | 7efd6f3 | 2022-06-22 10:42:56 +0800 | [diff] [blame] | 70 | |
| 71 | build_tests = get_option('tests') |
| 72 | if not build_tests.disabled() |
| 73 | subdir('test') |
| 74 | endif |