1# Generate Configuration Files from Yaml
2python_exe = find_program('python3', 'python')
3
4sensor_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)
15generated_src += sensor_gen
16
17invsensor_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)
28generated_src += invsensor_gen
29
30fru_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)
41generated_src += fru_gen
42