meson: enable full subproject build

Misc changes to the build process and adding wrap-files so that
the full repository can be built as a meson subproject.  This
depends on a few pending changes upstream in phosphor-host-ipmid,
but since that subproject references HEAD it will automatically
resolve as those changes are merged.

Change-Id: Ia3d50e0efa21b07ae4d4886f5930a270976670ed
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
diff --git a/meson.build b/meson.build
index 739bf5f..babd436 100644
--- a/meson.build
+++ b/meson.build
@@ -14,10 +14,10 @@
     meson_version: '>=1.1.1',
 )
 
-phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
-phosphor_logging = dependency('phosphor-logging')
-libipmid = dependency('libipmid')
-sdbusplus = dependency('sdbusplus')
+phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
+phosphor_logging_dep = dependency('phosphor-logging')
+ipmid_dep = dependency('libipmid')
+sdbusplus_dep = dependency('sdbusplus')
 
 # Common configurations for src and test
 cdata = configuration_data()
diff --git a/src/meson.build b/src/meson.build
index d8c3c0b..698258a 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -6,15 +6,22 @@
 
 so_version = '0.1.0'
 
+sources = [
+  'iei_oem.cpp',
+]
+
+deps = [
+  phosphor_dbus_interfaces_dep,
+  phosphor_logging_dep,
+  ipmid_dep,
+  sdbusplus_dep,
+]
+
 shared_library(
   'iei-ipmi-oem',
-  'iei_oem.cpp',
-  dependencies: [
-    phosphor_dbus_interfaces,
-    phosphor_logging,
-    libipmid,
-  ],
+  sources,
+  dependencies: deps,
   version: so_version,
   install: true,
   install_dir: get_option('libdir') / 'ipmid-providers'
-  )
+)
diff --git a/subprojects/phosphor-dbus-interfaces.wrap b/subprojects/phosphor-dbus-interfaces.wrap
new file mode 100644
index 0000000..346aa0c
--- /dev/null
+++ b/subprojects/phosphor-dbus-interfaces.wrap
@@ -0,0 +1,6 @@
+[wrap-git]
+url = https://github.com/openbmc/phosphor-dbus-interfaces.git
+revision = HEAD
+
+[provide]
+phosphor-dbus-interfaces = phosphor_dbus_interfaces_dep
diff --git a/subprojects/phosphor-host-ipmid.wrap b/subprojects/phosphor-host-ipmid.wrap
new file mode 100644
index 0000000..4eb85a2
--- /dev/null
+++ b/subprojects/phosphor-host-ipmid.wrap
@@ -0,0 +1,8 @@
+[wrap-git]
+url = https://github.com/openbmc/phosphor-host-ipmid
+revision = HEAD
+
+[provide]
+libipmid = ipmid_dep
+libchannellayer = channellayer_dep
+libuserlayer = userlayer_dep
diff --git a/subprojects/phosphor-logging.wrap b/subprojects/phosphor-logging.wrap
new file mode 100644
index 0000000..6876a6e
--- /dev/null
+++ b/subprojects/phosphor-logging.wrap
@@ -0,0 +1,6 @@
+[wrap-git]
+url = https://github.com/openbmc/phosphor-logging
+revision = HEAD
+
+[provide]
+phosphor-logging = phosphor_logging_dep
diff --git a/subprojects/sdbusplus.wrap b/subprojects/sdbusplus.wrap
new file mode 100644
index 0000000..42cfcee
--- /dev/null
+++ b/subprojects/sdbusplus.wrap
@@ -0,0 +1,6 @@
+[wrap-git]
+url = https://github.com/openbmc/sdbusplus
+revision = HEAD
+
+[provide]
+sdbusplus = sdbusplus_dep