meson support: create meson.build files
This commit contains the meson.build files necessary to build the
project and unit tests. The normal procedure is to run the command
'meson build' followed by ninja -C build. Additionally, service files
are copied to remove autoconf-style naming convention (they cannot be
removed before autoconf files are removed).
Signed-off-by: Mike Capps <mikepcapps@gmail.com>
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I6cf8f5c1c923a198ad2fb4638843645479fd0498
diff --git a/monitor/meson.build b/monitor/meson.build
new file mode 100644
index 0000000..d708cca
--- /dev/null
+++ b/monitor/meson.build
@@ -0,0 +1,59 @@
+phosphor_fan_monitor_include_directories = include_directories(
+ '.',
+ '..'
+)
+
+sources=[
+ 'argument.cpp',
+ 'conditions.cpp',
+ 'fan.cpp',
+ 'fan_error.cpp',
+ 'json_parser.cpp',
+ 'logging.cpp',
+ 'main.cpp',
+ 'power_interface.cpp',
+ 'system.cpp',
+ 'tach_sensor.cpp',
+ '../hwmon_ffdc.cpp'
+]
+
+deps=[
+ json_dep,
+ phosphor_dbus_interfaces_dep,
+ phosphor_logging_dep,
+ sdbusplus_dep,
+ sdeventplus_dep
+]
+
+# Only needed for YAML config
+if get_option('json-config').disabled()
+ fan_monitor_defs_cpp_dep = custom_target(
+ 'fan_monitor_defs.cpp',
+ input: files(
+ './gen-fan-monitor-defs.py',
+ conf.get_unquoted('FAN_MONITOR_YAML_FILE'),
+ ),
+ command: [
+ python_prog, '@INPUT0@',
+ '-m','@INPUT1@',
+ '-o','monitor'
+ ],
+ output: 'fan_monitor_defs.cpp'
+ )
+
+ sources += fan_monitor_defs_cpp_dep
+endif
+
+phosphor_fan_monitor = executable(
+ 'phosphor-fan-monitor',
+ sources,
+ dependencies: deps,
+ implicit_include_directories: false,
+ include_directories: phosphor_fan_monitor_include_directories,
+ install: true
+)
+
+if(get_option('tests').enabled())
+ subdir('test')
+endif
+