meson: Add meson build
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Id1694bde6c57cab65ca86b00f64285f4d6224b2d
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..54e39f9
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,61 @@
+templates_depends = files(
+ 'example/example.yaml',
+ 'example/test.yaml',
+ 'templates/callbackgroup.mako.cpp',
+ 'templates/conditional.mako.cpp',
+ 'templates/count.mako.cpp',
+ 'templates/median.mako.cpp',
+ 'templates/generated.mako.hpp',
+ 'templates/journal.mako.cpp',
+ 'templates/elog.mako.cpp',
+ 'templates/errors.mako.hpp',
+ 'templates/method.mako.cpp',
+ 'templates/resolve_errors.mako.cpp',
+ 'templates/event.mako.cpp',
+)
+
+generated_hpp = custom_target(
+ 'generated.hpp',
+ command: [
+ prog_python,
+ meson.project_source_root() + '/src/pdmgen.py',
+ '-t', 'generated.mako.hpp',
+ '-p', meson.project_source_root() + '/src/templates',
+ '-d', meson.project_source_root() + '/' + get_option('YAML_PATH'),
+ '-o', meson.current_build_dir() + '/generated.hpp',
+ 'generate-cpp'
+ ],
+ depend_files: templates_depends,
+ output: 'generated.hpp',
+)
+
+sources = [
+ generated_hpp,
+ 'elog.cpp',
+ 'event_manager.cpp',
+ 'event_serialize.cpp',
+ 'journal.cpp',
+ 'main.cpp',
+ 'pathwatch.cpp',
+ 'propertywatch.cpp',
+ 'resolve_errors.cpp',
+ 'snmp_trap.cpp',
+]
+
+deps = [
+ sdbusplus_dep,
+ sdeventplus_dep,
+ phosphor_dbus_interfaces_dep,
+ phosphor_logging_dep,
+ phosphor_snmp_dep,
+]
+
+executable(
+ 'phosphor-dbus-monitor',
+ sources,
+ include_directories: ['..'],
+ implicit_include_directories: true,
+ dependencies: deps,
+ install: true,
+ install_dir: get_option('bindir'),
+)