xref: /openbmc/smbios-mdr/src/meson.build (revision 6981b7ffb8a81bd1ea90c8deba8466accbe2693b)
1cpp_args_smbios = boost_args
2if get_option('dimm-dbus').allowed()
3    cpp_args_smbios += ['-DDIMM_DBUS']
4endif
5
6if get_option('assoc-trim-path').allowed()
7    cpp_args_smbios += ['-DASSOC_TRIM_PATH']
8endif
9
10if get_option('dimm-only-locator').allowed()
11    cpp_args_smbios += ['-DDIMM_ONLY_LOCATOR']
12endif
13
14if get_option('slot-drive-presence').allowed()
15    cpp_args_smbios += ['-DSLOT_DRIVE_PRESENCE']
16endif
17
18if get_option('tpm-dbus').allowed()
19    cpp_args_smbios += ['-DTPM_DBUS']
20endif
21
22if get_option('firmware-inventory-dbus').allowed()
23    cpp_args_smbios += ['-DFIRMWARE_INVENTORY_DBUS']
24endif
25
26if get_option('expose-firmware-component-name').allowed()
27    cpp_args_smbios += ['-DEXPOSE_FW_COMPONENT_NAME']
28endif
29
30executable(
31    'smbiosmdrv2app',
32    'mdrv2.cpp',
33    'mdrv2_main.cpp',
34    'cpu.cpp',
35    'dimm.cpp',
36    'system.cpp',
37    'pcieslot.cpp',
38    'tpm.cpp',
39    'firmware_inventory.cpp',
40    cpp_args: cpp_args_smbios,
41    dependencies: [
42        boost_dep,
43        sdbusplus_dep,
44        phosphor_logging_dep,
45        phosphor_dbus_interfaces_dep,
46    ],
47    implicit_include_directories: false,
48    include_directories: root_inc,
49    install: true,
50)
51
52if get_option('cpuinfo').allowed()
53    cpp = meson.get_compiler('cpp')
54    # i2c-tools provides no pkgconfig so we need to find it manually
55    i2c_dep = cpp.find_library('i2c')
56
57    peci_dep = []
58    peci_flag = []
59    peci_files = []
60    if get_option('cpuinfo-peci').allowed()
61        peci_flag = '-DPECI_ENABLED=1'
62        peci_dep = dependency('libpeci')
63        peci_files = ['speed_select.cpp', 'sst_mailbox.cpp']
64    endif
65
66    executable(
67        'cpuinfoapp',
68        'cpuinfo_main.cpp',
69        'cpuinfo_utils.cpp',
70        peci_files,
71        cpp_args: boost_args + peci_flag,
72        dependencies: [
73            boost_dep,
74            sdbusplus_dep,
75            phosphor_logging_dep,
76            phosphor_dbus_interfaces_dep,
77            i2c_dep,
78            peci_dep,
79        ],
80        implicit_include_directories: false,
81        include_directories: root_inc,
82        install: true,
83    )
84endif
85
86if get_option('smbios-ipmi-blob').allowed()
87    subdir('smbios-ipmi-blobs')
88endif
89