1project( 2 'ipmi-fru-parser', 3 'cpp', 4 version: '1.0', 5 default_options: [ 6 'buildtype=debugoptimized', 7 'cpp_std=c++23', 8 'warning_level=3', 9 'werror=true', 10 ], 11 meson_version: '>=1.1.1', 12) 13 14cxx = meson.get_compiler('cpp') 15 16phosphor_logging_dep = dependency('phosphor-logging') 17sdbusplus_dep = dependency('sdbusplus') 18ipmid_dep = dependency('libipmid') 19 20if cxx.has_header('CLI/CLI.hpp') 21 CLI11_dep = declare_dependency() 22else 23 CLI11_dep = dependency('CLI11') 24endif 25 26python_prog = find_program('python3', native: true) 27 28fru_gen = custom_target( 29 'fru-gen.cpp'.underscorify(), 30 input: ['scripts/fru_gen.py', get_option('fru_yaml')], 31 output: 'fru-gen.cpp', 32 command: [ 33 python_prog, 34 '@INPUT0@', 35 '-i', 36 '@INPUT1@', 37 '-o', 38 meson.current_build_dir(), 39 'generate-cpp', 40 ], 41) 42 43properties_gen = custom_target( 44 'extra-properties-gen.cpp'.underscorify(), 45 input: ['scripts/extra-properties.py', get_option('properties_yaml')], 46 output: 'extra-properties-gen.cpp', 47 command: [python_prog, '@INPUT0@', '-e', '@INPUT1@'], 48) 49 50writefrudata_lib = library( 51 'writefrudata', 52 fru_gen, 53 properties_gen, 54 'fru_area.cpp', 55 'frup.cpp', 56 'writefrudata.cpp', 57 dependencies: [sdbusplus_dep, phosphor_logging_dep, ipmid_dep], 58 version: meson.project_version(), 59 install: true, 60) 61 62writefrudata_dep = declare_dependency(link_with: writefrudata_lib) 63 64strgfnhandler_lib = library( 65 'strgfnhandler', 66 'strgfnhandler.cpp', 67 dependencies: [writefrudata_dep, phosphor_logging_dep, ipmid_dep], 68 override_options: ['b_lundef=false'], 69 version: meson.project_version(), 70 install: true, 71 install_dir: get_option('libdir') / 'ipmid-providers', 72) 73 74executable( 75 'phosphor-read-eeprom', 76 'readeeprom.cpp', 77 dependencies: [ 78 CLI11_dep, 79 phosphor_logging_dep, 80 sdbusplus_dep, 81 writefrudata_dep, 82 ], 83 install: true, 84) 85