Enable Yocto control of the USING_ENTITY_MANAGER_DECORATORS
The USING_ENTITY_MANAGER_DECORATORS compile switch is hard coded to
enabled in a header file. The changes here allow the feature to be
controlled in recipes via PACKAGECONFIG entries in bbappend files.
Tested:
Applied https://gerrit.openbmc.org/c/openbmc/openbmc/+/63434
Modified internal bbappend file to PACKAGECONFIG:remove
entity-manager-decorators
Confirmed the code guarded by the ifdef no longer compiled
Removed change to bbappend file
Confirmed the code guarded by the ifdef was restored.
Change-Id: I4f3072451f893fcb5edaa478d0546253e7005b9f
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
diff --git a/dbus-sdr/storagecommands.cpp b/dbus-sdr/storagecommands.cpp
index f123e99..874e5b2 100644
--- a/dbus-sdr/storagecommands.cpp
+++ b/dbus-sdr/storagecommands.cpp
@@ -569,7 +569,7 @@
return IPMI_CC_OK;
}
-ipmi_ret_t getFruSdrs(ipmi::Context::ptr ctx, size_t index,
+ipmi_ret_t getFruSdrs([[maybe_unused]] ipmi::Context::ptr ctx, size_t index,
get_sdr::SensorDataFruRecord& resp)
{
if (deviceHashes.size() < index)
diff --git a/include/dbus-sdr/storagecommands.hpp b/include/dbus-sdr/storagecommands.hpp
index 4e3eb34..c8baaf1 100644
--- a/include/dbus-sdr/storagecommands.hpp
+++ b/include/dbus-sdr/storagecommands.hpp
@@ -19,8 +19,6 @@
#include <cstdint>
-#define USING_ENTITY_MANAGER_DECORATORS
-
static constexpr uint8_t ipmiSdrVersion = 0x51;
namespace dynamic_sensors::ipmi::sel
diff --git a/meson.build b/meson.build
index 2b82689..9ea6e1c 100644
--- a/meson.build
+++ b/meson.build
@@ -75,6 +75,7 @@
'update-functional-on-fail' : '-DUPDATE_FUNCTIONAL_ON_FAIL',
'dynamic-sensors' : '-DFEATURE_DYNAMIC_SENSORS',
'dynamic-sensors-write' : '-DFEATURE_DYNAMIC_SENSORS_WRITE',
+ 'entity-manager-decorators' : '-DUSING_ENTITY_MANAGER_DECORATORS',
'hybrid-sensors' : '-DFEATURE_HYBRID_SENSORS',
'sensors-cache' : '-DFEATURE_SENSORS_CACHE',
'sel-logger-clears-sel' : '-DFEATURE_SEL_LOGGER_CLEARS_SEL',
diff --git a/meson_options.txt b/meson_options.txt
index aa21246..59c597f 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -49,6 +49,9 @@
option('ipmi-whitelist', type: 'feature', description: 'Enable/disable IPMI whitelist filtering')
option('whitelist-conf', type: 'string', value: 'host-ipmid-whitelist.conf', description: 'Paths to IPMI whitelisted commands conf files')
+# Entity Manager Decorators
+option('entity-manager-decorators', type: 'feature', value: 'enabled', description: 'The Entity Manager Decorators flag is enabled by default; offer a way to disable it')
+
# Dynamic Sensor Stack
option('dynamic-sensors', type: 'feature', value: 'disabled', description: 'Dynamic sensors stack is enabled by default; offer a way to disable it')
option('dynamic-sensors-write', type: 'feature', value: 'disabled', description: 'Dynamic sensors stack is enabled by default; offer a way to disable it')