fault-monitor: Add monitor-opertaional-status to meson.build
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I9ebe31773dc865b4ade9fbca985470d79d7dbe7a
diff --git a/fault-monitor/meson.build b/fault-monitor/meson.build
index ef7dfd1..254a218 100644
--- a/fault-monitor/meson.build
+++ b/fault-monitor/meson.build
@@ -1,9 +1,19 @@
fault_monitor_sources = [
generated_sources,
- 'fru-fault-monitor.cpp',
'monitor-main.cpp',
]
+if get_option('monitor-operational-status').enabled()
+ fault_monitor_sources += [
+ '../utils.cpp',
+ 'operational-status-monitor.cpp',
+ ]
+else
+ fault_monitor_sources += [
+ 'fru-fault-monitor.cpp',
+ ]
+endif
+
executable(
'phosphor-fru-fault-monitor',
fault_monitor_sources,
diff --git a/meson.build b/meson.build
index 874a498..6412a4c 100644
--- a/meson.build
+++ b/meson.build
@@ -23,6 +23,7 @@
conf_data.set('CLASS_VERSION', 1)
conf_data.set('LED_USE_JSON', get_option('use-json').enabled())
conf_data.set('USE_LAMP_TEST', get_option('use-lamp-test').enabled())
+conf_data.set('MONITOR_OPERATIONAL_STATUS', get_option('monitor-operational-status').enabled())
sdbusplus_dep = dependency('sdbusplus', required: false)
if sdbusplus_dep.found()
diff --git a/meson_options.txt b/meson_options.txt
index 0ae13a5..f56d5d9 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,4 @@
option('tests', type : 'feature', description : 'Build tests', value: 'enabled')
option('use-json', type : 'feature', description : 'LEDs JSON filepath', value: 'disabled')
-option('use-lamp-test', type : 'feature', description : 'LEDs lamp test configuration', value: 'disabled')
\ No newline at end of file
+option('use-lamp-test', type : 'feature', description : 'LEDs lamp test configuration', value: 'disabled')
+option('monitor-operational-status', type : 'feature', description : 'Enable OperationalStatus monitor', value: 'disabled')
\ No newline at end of file