bmc: only build file handlers if configured
The file handlers for the various configurations were built but only
used when appropriate. Do not build them if they're going to be
presumably stripped out during linking.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I16765bb263b3ecefb12d592bbd06b954663475ff
diff --git a/main.cpp b/main.cpp
index a711227..b4681a6 100644
--- a/main.cpp
+++ b/main.cpp
@@ -36,8 +36,12 @@
namespace
{
FileHandler hashHandler(HASH_FILENAME);
+#ifdef ENABLE_STATIC_LAYOUT
FileHandler staticLayoutHandler(STATIC_HANDLER_STAGED_NAME);
+#endif
+#ifdef ENABLE_TARBALL_UBI
FileHandler ubitarballHandler(TARBALL_STAGED_NAME);
+#endif
/* The maximum external buffer size we expect is 64KB. */
static constexpr std::size_t memoryRegionSize = 64 * 1024UL;