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 | |
| 4 | sensor_yaml_script = files('sensor_gen.py') |
| 5 | sensor_yaml_gen = run_command( \ |
| 6 | python_exe, \ |
| 7 | sensor_yaml_script, \ |
| 8 | '-i', get_option('sensor-yaml-gen'), \ |
| 9 | '-o', meson.project_build_root(), \ |
| 10 | 'generate-cpp') |
| 11 | if sensor_yaml_gen.returncode() != 0 |
| 12 | error(sensor_yaml_gen.stderr()) |
| 13 | endif |
| 14 | |
| 15 | invsensor_yaml_script = files('inventory-sensor.py') |
| 16 | invsensor_yaml_gen = run_command( \ |
| 17 | python_exe, \ |
| 18 | invsensor_yaml_script, \ |
| 19 | '-i', get_option('invsensor-yaml-gen'), \ |
| 20 | '-o', meson.project_build_root(), \ |
| 21 | 'generate-cpp') |
| 22 | if invsensor_yaml_gen.returncode() != 0 |
| 23 | error(invsensor_yaml_gen.stderr()) |
| 24 | endif |
| 25 | |
| 26 | fru_yaml_script = files('fru_gen.py') |
| 27 | fru_yaml_gen = run_command( \ |
| 28 | python_exe, \ |
| 29 | fru_yaml_script, \ |
| 30 | '-i', get_option('fru-yaml-gen'), \ |
| 31 | '-o', meson.project_build_root(), \ |
| 32 | 'generate-cpp') |
| 33 | if fru_yaml_gen.returncode() != 0 |
| 34 | error(fru_yaml_gen.stderr()) |
| 35 | endif |