pldm: Fix build configuration when libpldmresponder is disabled
Move HEARTBEAT_TIMEOUT and DBUS_TIMEOUT configuration outside
libpldmresponder conditional block as these are core settings needed
regardless of libpldmresponder being enabled. Also properly guard
hostEffecterParser initialization with LIBPLDMRESPONDER ifdef to
prevent compilation errors when the feature is disabled.
Change-Id: Ia5c73309dec2380863e6ac60739c6a0b9ec67940
Signed-off-by: P Arun Kumar Reddy <arunpapannagari23@gmail.com>
diff --git a/meson.build b/meson.build
index aff9ca1..3c7db76 100644
--- a/meson.build
+++ b/meson.build
@@ -68,12 +68,12 @@
'EVENTS_JSONS_DIR',
join_paths(package_datadir, 'events'),
)
- conf_data.set('HEARTBEAT_TIMEOUT', get_option('heartbeat-timeout-seconds'))
conf_data.set('TERMINUS_ID', get_option('terminus-id'))
conf_data.set('TERMINUS_HANDLE', get_option('terminus-handle'))
- conf_data.set('DBUS_TIMEOUT', get_option('dbus-timeout-value'))
add_project_arguments('-DLIBPLDMRESPONDER', language: 'cpp')
endif
+conf_data.set('HEARTBEAT_TIMEOUT', get_option('heartbeat-timeout-seconds'))
+conf_data.set('DBUS_TIMEOUT', get_option('dbus-timeout-value'))
if get_option('softoff').allowed()
conf_data.set(
'SOFTOFF_TIMEOUT_SECONDS',
diff --git a/pldmd/pldmd.cpp b/pldmd/pldmd.cpp
index 637ed63..cdb20b7 100644
--- a/pldmd/pldmd.cpp
+++ b/pldmd/pldmd.cpp
@@ -221,12 +221,6 @@
std::unique_ptr<platform_mc::Manager> platformManager =
std::make_unique<platform_mc::Manager>(event, reqHandler, instanceIdDb);
- std::unique_ptr<pldm::host_effecters::HostEffecterParser>
- hostEffecterParser =
- std::make_unique<pldm::host_effecters::HostEffecterParser>(
- &instanceIdDb, pldmTransport.getEventSource(), pdrRepo.get(),
- &dbusHandler, HOST_JSONS_DIR, &reqHandler,
- platformManager.get());
#ifdef LIBPLDMRESPONDER
using namespace pldm::state_sensor;
dbus_api::Host dbusImplHost(bus, "/xyz/openbmc_project/pldm");
@@ -256,6 +250,13 @@
if (hostEID)
{
+ std::unique_ptr<pldm::host_effecters::HostEffecterParser>
+ hostEffecterParser =
+ std::make_unique<pldm::host_effecters::HostEffecterParser>(
+ &instanceIdDb, pldmTransport.getEventSource(),
+ pdrRepo.get(), &dbusHandler, HOST_JSONS_DIR, &reqHandler,
+ platformManager.get());
+
hostPDRHandler = std::make_shared<HostPDRHandler>(
pldmTransport.getEventSource(), hostEID, event, pdrRepo.get(),
EVENTS_JSONS_DIR, entityTree.get(), bmcEntityTree.get(),