xref: /openbmc/phosphor-host-ipmid/scripts/meson.build (revision 62ce1594fde138f073749e0bc56f6a4f1bb6b204)
1# Generate Configuration Files from Yaml
2python_exe = find_program('python3', 'python')
3
4sensor_gen = custom_target(
5    'sensor-gen',
6    output: 'sensor-gen.cpp',
7    input: ['sensor_gen.py', get_option('sensor-yaml-gen')],
8    command: [
9        python_exe,
10        '@INPUT0@',
11        '-i',
12        '@INPUT1@',
13        '-o',
14        meson.current_build_dir(),
15        'generate-cpp',
16    ],
17)
18generated_src += sensor_gen
19
20invsensor_gen = custom_target(
21    'invsensor-gen',
22    output: 'inventory-sensor-gen.cpp',
23    input: ['inventory-sensor.py', get_option('invsensor-yaml-gen')],
24    command: [
25        python_exe,
26        '@INPUT0@',
27        '-i',
28        '@INPUT1@',
29        '-o',
30        meson.current_build_dir(),
31        'generate-cpp',
32    ],
33)
34generated_src += invsensor_gen
35
36fru_gen = custom_target(
37    'fru-gen',
38    output: 'fru-read-gen.cpp',
39    input: ['fru_gen.py', get_option('fru-yaml-gen')],
40    command: [
41        python_exe,
42        '@INPUT0@',
43        '-i',
44        '@INPUT1@',
45        '-o',
46        meson.current_build_dir(),
47        'generate-cpp',
48    ],
49)
50generated_src += fru_gen
51