Default to libhei subproject if library not installed

Change-Id: I66d66a2d0df4bd071a951ba775c22aca4310fd92
Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
diff --git a/README.md b/README.md
index a1d9af5..d49da90 100644
--- a/README.md
+++ b/README.md
@@ -6,3 +6,21 @@
 service action needed to avoid repeated system failures.
 
 Aditional details TBD.
+
+Building
+--------
+
+For a standard OpenBMC release build, you want something like:
+```
+meson -Dtests=disabled <build_dir>
+ninja -C <build_dir>
+ninja -C <build_dir> install
+```
+
+For a test / debug build, a typical configuration is:
+```
+meson -Dtests=enabled <build_dir>
+ninja -C <build_dir> test
+```
+
+
diff --git a/meson.build b/meson.build
index e4ef613..352e5e4 100644
--- a/meson.build
+++ b/meson.build
@@ -1,3 +1,4 @@
+# See README.md for details.
 project('openpower-hw-diags', 'cpp',
         version: '0.1', meson_version: '>=0.49.0',
         default_options: [
@@ -7,7 +8,9 @@
           'cpp_args=-Wno-unused-parameter'
         ])
 
-libhei_dep = dependency('hei', required : true)
+# First, look if the libhei library has already been built and installed. If
+# not, default to the subproject.
+libhei_dep = dependency('hei', fallback : ['libhei', 'libhei_dep'])
 
 incdir = include_directories('.')
 
diff --git a/subprojects/libhei.wrap b/subprojects/libhei.wrap
new file mode 100644
index 0000000..a603328
--- /dev/null
+++ b/subprojects/libhei.wrap
@@ -0,0 +1,3 @@
+[wrap-git]
+url = https://github.com/openbmc/openpower-libhei
+revision = head