build: build biccommands always
Limit the amount of code that is #ifdef'd out from a normal
build, so compile issues do not escape, by only #ifdef'ing
out the function that registers the BIC-based IPMI handlers
and not the majority of the code to handle BIC-related IPMI
commands. This allows us to identify compile failures in
unit-testing.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I2131f81890865c8189c6846987c5068373c68203
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 71303e9..9c94572 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,17 +61,15 @@
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include)
-SET(bicFile "")
-
if(BIC)
- SET(bicFile "src/biccommands.cpp")
add_definitions (-DBIC_ENABLED)
endif()
add_library (zfboemcmds
SHARED src/oemcommands.cpp src/appcommands.cpp
src/storagecommands.cpp src/usb-dbg.cpp
- src/selcommands.cpp src/transportcommands.cpp ${bicFile})
+ src/selcommands.cpp src/transportcommands.cpp
+ src/biccommands.cpp)
if(HOST_INSTANCES)
add_definitions (-DINSTANCES="${HOST_INSTANCES}")
diff --git a/src/biccommands.cpp b/src/biccommands.cpp
index 017690c..6932b6f 100644
--- a/src/biccommands.cpp
+++ b/src/biccommands.cpp
@@ -31,7 +31,9 @@
using namespace phosphor::logging;
+#ifdef BIC_ENABLED
static void registerBICFunctions() __attribute__((constructor));
+#endif
extern message::Response::ptr executeIpmiCommand(message::Request::ptr);