meson: support custom led yaml path
Most machines using phosphor-led-manager push their led.yaml with
virtual/phosphor-led-manager-config-native, which installs led.yaml
to a native tree.
Without led yaml path support, those machines are getting the wrong
led groups.
For compatibility, add this support back.
Signed-off-by: Seires Li <seiresli@pcpartner.com>
Change-Id: I73aced08a288db5d70440e0c18d194a30158e467
diff --git a/meson.build b/meson.build
index 46b90af..6b446ce 100644
--- a/meson.build
+++ b/meson.build
@@ -127,13 +127,19 @@
'utils.cpp',
]
+ledyamlpath = get_option('led-yaml-path')
+
+if ledyamlpath == ''
+ ledyamlpath = meson.project_source_root()
+endif
+
if get_option('use-json').disabled()
led_gen_hpp = custom_target(
'led-gen.hpp',
command : [
prog_python,
meson.project_source_root() + '/parse_led.py',
- '-i', meson.project_source_root(),
+ '-i', ledyamlpath,
'-o', meson.current_build_dir(),
],
output : 'led-gen.hpp')
diff --git a/meson_options.txt b/meson_options.txt
index f56d5d9..0b6f579 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,4 +1,5 @@
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')
-option('monitor-operational-status', type : 'feature', description : 'Enable OperationalStatus monitor', value: 'disabled')
\ No newline at end of file
+option('monitor-operational-status', type : 'feature', description : 'Enable OperationalStatus monitor', value: 'disabled')
+option('led-yaml-path', type : 'string', value : '', description : 'where the led yaml is')