Support to build storage commands in libipmi20

Currently, the storage commands only is built in the libdynamicsensor
library. To build those commands, we have to enable dynamic-sensor
option which makes sensor commands are built too.

To allow compiling storage commands w/o sensor commands, this commit
adds 'dynamic-storages-only' option to request to build storage commands
in libipmi20 library.

Tested:
  1. Disable dynamic-sensor option and enable dynamic-storages-only
     option.
  2. Built the openBmc image and flash to the board.
  3. Request to read/write FRU device via ipmitool.
     All of request work well.
  4. Request to read SEL list.
     Display list of SEL logs.

Signed-off-by: Thang Tran <thuutran@amperecomputing.com>
Change-Id: I330919e7eebbb80bf568f36ead69ade670b2f8d1
diff --git a/meson.build b/meson.build
index 1fd2b6b..0cd2f44 100644
--- a/meson.build
+++ b/meson.build
@@ -79,6 +79,7 @@
   'hybrid-sensors'             : '-DFEATURE_HYBRID_SENSORS',
   'sensors-cache'              : '-DFEATURE_SENSORS_CACHE',
   'sel-logger-clears-sel'      : '-DFEATURE_SEL_LOGGER_CLEARS_SEL',
+  'dynamic-storages-only'      : '-DFEATURE_DYNAMIC_STORAGES_ONLY',
 }
 
 foreach option_key, option_value : feature_map
@@ -204,6 +205,11 @@
   transportoem_src = ['transporthandler_oem.cpp']
 endif
 
+storage_cmds_src = []
+if get_option('dynamic-sensors').disabled() and not get_option('dynamic-storages-only').disabled()
+  storage_cmds_src = ['dbus-sdr/storagecommands.cpp', 'dbus-sdr/sdrutils.cpp']
+endif
+
 libipmi20_src = [
   'app/channel.cpp',
   'app/watchdog.cpp',
@@ -226,6 +232,7 @@
   'user_channel/channelcommands.cpp',
   generated_src,
   transportoem_src,
+  storage_cmds_src,
   conf_h,
 ]