meson: add options for each application
None of our users use _all_ of phosphor-power - give them the ability to
configure in or out whatever applications they require.
Initially align options to how downstream distros (OpenBMC) are already
packaging our applications:
utils - general purpose utilities.
supply-monitor - the original power supply monitor.
supply-monitor-ng - the power supply monitor rewrite.
regulators - support for regulator config, control and monitoring.
sequencer-monitor - support for monitoring the ucd90160 power sequencer.
cold-redundancy - support for cold redundancy
Change-Id: Idac1860bb2648717d7c43b849757c5ddd6a23ab0
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meson.build b/meson.build
index 3c54ec4..58e57de 100644
--- a/meson.build
+++ b/meson.build
@@ -44,21 +44,23 @@
servicedir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
services = [
- 'power-supply-monitor@.service',
- 'pseq-monitor-pgood.service',
- 'pseq-monitor.service',
- 'phosphor-psu-monitor.service',
- 'phosphor-regulators.service',
- 'phosphor-regulators-config.service',
- 'phosphor-regulators-monitor-enable.service',
- 'phosphor-regulators-monitor-disable.service'
+ ['supply-monitor', 'power-supply-monitor@.service'],
+ ['sequencer-monitor', 'pseq-monitor-pgood.service'],
+ ['sequencer-monitor', 'pseq-monitor.service'],
+ ['supply-monitor-ng', 'phosphor-psu-monitor.service'],
+ ['regulators', 'phosphor-regulators.service'],
+ ['regulators', 'phosphor-regulators-config.service'],
+ ['regulators', 'phosphor-regulators-monitor-enable.service'],
+ ['regulators', 'phosphor-regulators-monitor-disable.service'],
]
foreach service : services
- configure_file(input: 'services/' + service,
- output: service,
+ if get_option(service[0])
+ configure_file(input: 'services/' + service[1],
+ output: service[1],
copy: true,
install_dir: servicedir)
+ endif
endforeach
# Get the power sequencer class name
@@ -116,12 +118,24 @@
# Meson variables defined there.
subdir('tools/i2c')
-subdir('phosphor-regulators')
-subdir('power-sequencer')
-subdir('power-supply')
-subdir('phosphor-power-supply')
-subdir('tools/power-utils')
+if get_option('regulators')
+ subdir('phosphor-regulators')
+endif
+if get_option('sequencer-monitor')
+ subdir('power-sequencer')
+endif
+if get_option('supply-monitor')
+ subdir('power-supply')
+endif
+if get_option('supply-monitor-ng')
+ subdir('phosphor-power-supply')
+endif
+if get_option('utils')
+ subdir('tools/power-utils')
+endif
if get_option('tests').enabled()
subdir('test')
endif
-subdir('cold-redundancy')
+if get_option('cold-redundancy')
+ subdir('cold-redundancy')
+endif