Change scope of auto-generated build info header

This file is only needed when built in openpower-hw-diags for openbmc.
It is not needed when built in Hostboot or other user applications. The
header and supporting functions were pulled out of the rest of the
libhei source so that it can build in Hostboot or other user
applications.

Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
Change-Id: Ica5e6e6141acfe1866459a43df448b5c6ee3d29e
diff --git a/meson.build b/meson.build
index 020bf73..426467e 100644
--- a/meson.build
+++ b/meson.build
@@ -41,6 +41,7 @@
                                 install: true)
 
 install_headers(
+    'src/hei_buildinfo.hpp',
     'src/hei_chip.hpp',
     'src/hei_isolation_data.hpp',
     'src/hei_main.hpp',
diff --git a/src/hei_buildinfo.hpp b/src/hei_buildinfo.hpp
new file mode 100644
index 0000000..f230124
--- /dev/null
+++ b/src/hei_buildinfo.hpp
@@ -0,0 +1,18 @@
+#pragma once
+
+#include <buildinfo.hpp>
+
+// TODO: It would be preferred that this function exist in buildinfo.hpp.
+//       However, due to meson limitations, we were not able to figure out how
+//       to install that auto-generated header so it could be available to
+//       the user applications.
+
+namespace libhei
+{
+
+inline const char* getBuildInfo()
+{
+    return BUILDINFO;
+}
+
+} // end namespace libhei
diff --git a/src/hei_main.hpp b/src/hei_main.hpp
index 7135f50..9c484fe 100644
--- a/src/hei_main.hpp
+++ b/src/hei_main.hpp
@@ -91,11 +91,4 @@
  */
 void isolate(const std::vector<Chip>& i_chipList, IsolationData& o_isoData);
 
-/**
- * @brief Return build information string
- *
- * @return Build information string
- */
-const char* getBuildInfo();
-
 } // end namespace libhei
diff --git a/src/isolator/hei_isolator.cpp b/src/isolator/hei_isolator.cpp
index ef74b2e..f431cb3 100644
--- a/src/isolator/hei_isolator.cpp
+++ b/src/isolator/hei_isolator.cpp
@@ -1,5 +1,4 @@
 
-#include <buildinfo.hpp>
 #include <isolator/hei_isolation_node.hpp>
 #include <isolator/hei_isolator.hpp>
 #include <register/hei_operator_register.hpp>
@@ -74,9 +73,4 @@
     }
 }
 
-const char* getBuildInfo()
-{
-    return BUILDINFO;
-}
-
 } // end namespace libhei