Willy Tu | c710b97 | 2021-08-11 16:33:43 -0700 | [diff] [blame] | 1 | # Generate Configuration Files from Yaml |
| 2 | python_exe = find_program('python3', 'python') |
| 3 | |
Patrick Williams | b69b206 | 2022-07-25 09:40:49 -0500 | [diff] [blame] | 4 | sensor_gen = custom_target('sensor-gen', |
| 5 | output: 'sensor-gen.cpp', |
| 6 | input: [ 'sensor_gen.py', get_option('sensor-yaml-gen')], |
| 7 | command: [ |
| 8 | python_exe, |
| 9 | '@INPUT0@', |
| 10 | '-i', '@INPUT1@', |
| 11 | '-o', meson.current_build_dir(), |
| 12 | 'generate-cpp', |
| 13 | ], |
| 14 | ) |
| 15 | generated_src += sensor_gen |
Willy Tu | c710b97 | 2021-08-11 16:33:43 -0700 | [diff] [blame] | 16 | |
Patrick Williams | b69b206 | 2022-07-25 09:40:49 -0500 | [diff] [blame] | 17 | invsensor_gen = custom_target('invsensor-gen', |
| 18 | output: 'inventory-sensor-gen.cpp', |
| 19 | input: [ 'inventory-sensor.py', get_option('invsensor-yaml-gen')], |
| 20 | command: [ |
| 21 | python_exe, |
| 22 | '@INPUT0@', |
| 23 | '-i', '@INPUT1@', |
| 24 | '-o', meson.current_build_dir(), |
| 25 | 'generate-cpp', |
| 26 | ], |
| 27 | ) |
| 28 | generated_src += invsensor_gen |
Willy Tu | c710b97 | 2021-08-11 16:33:43 -0700 | [diff] [blame] | 29 | |
Patrick Williams | b69b206 | 2022-07-25 09:40:49 -0500 | [diff] [blame] | 30 | fru_gen = custom_target('fru-gen', |
| 31 | output: 'fru-read-gen.cpp', |
| 32 | input: [ 'fru_gen.py', get_option('fru-yaml-gen') ], |
| 33 | command: [ |
| 34 | python_exe, |
| 35 | '@INPUT0@', |
| 36 | '-i', '@INPUT1@', |
| 37 | '-o', meson.current_build_dir(), |
| 38 | 'generate-cpp', |
| 39 | ], |
| 40 | ) |
| 41 | generated_src += fru_gen |