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/presence/meson.build b/presence/meson.build
new file mode 100644
index 0000000..d3028d6
--- /dev/null
+++ b/presence/meson.build
@@ -0,0 +1,57 @@
+
+phosphor_fan_presence_include_directories = include_directories(
+ '.',
+ '..'
+)
+
+sources=[
+ 'anyof.cpp',
+ 'error_reporter.cpp',
+ 'fallback.cpp',
+ 'fan.cpp',
+ 'get_power_state.cpp',
+ 'gpio.cpp',
+ 'json_parser.cpp',
+ 'logging.cpp',
+ 'psensor.cpp',
+ 'tach.cpp',
+ 'tach_detect.cpp'
+]
+
+deps=[
+ libevdev_dep,
+ phosphor_dbus_interfaces_dep,
+ phosphor_logging_dep,
+ sdbusplus_dep,
+ sdeventplus_dep
+]
+
+# Only needed for YAML config
+if get_option('json-config').disabled()
+ generated_hpp_dep = custom_target(
+ 'generated.hpp',
+ input: files(
+ './pfpgen.py',
+ conf.get_unquoted('PRESENCE_YAML_FILE')
+ ),
+ command: [
+ python_prog, '@INPUT0@',
+ 'generate-cpp',
+ '-i', '@INPUT1@'
+ ],
+ capture: true,
+ output: 'generated.hpp'
+ )
+
+ sources += generated_hpp_dep
+endif
+
+phosphor_fan_presence = executable(
+ 'phosphor-fan-presence-tach',
+ sources,
+ dependencies : deps,
+ implicit_include_directories: false,
+ include_directories: phosphor_fan_presence_include_directories,
+ install: true
+)
+