xref: /openbmc/smbios-mdr/src/meson.build (revision ed3d4d1b2bd379c810b92d451ded0a88f550701f)
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
30if get_option('custom-dbus-path').allowed()
31    cpp_args_smbios += ['-DCUSTOM_DBUS_PATH']
32endif
33
34executable(
35    'smbiosmdrv2app',
36    'mdrv2.cpp',
37    'mdrv2_main.cpp',
38    'cpu.cpp',
39    'dimm.cpp',
40    'system.cpp',
41    'pcieslot.cpp',
42    'tpm.cpp',
43    'firmware_inventory.cpp',
44    cpp_args: cpp_args_smbios,
45    dependencies: [
46        boost_dep,
47        sdbusplus_dep,
48        phosphor_logging_dep,
49        phosphor_dbus_interfaces_dep,
50    ],
51    implicit_include_directories: false,
52    include_directories: root_inc,
53    install: true,
54)
55
56if get_option('cpuinfo').allowed()
57    cpp = meson.get_compiler('cpp')
58    # i2c-tools provides no pkgconfig so we need to find it manually
59    i2c_dep = cpp.find_library('i2c')
60
61    peci_dep = []
62    peci_flag = []
63    peci_files = []
64    if get_option('cpuinfo-peci').allowed()
65        peci_flag = '-DPECI_ENABLED=1'
66        peci_dep = dependency('libpeci')
67        peci_files = ['speed_select.cpp', 'sst_mailbox.cpp']
68    endif
69
70    executable(
71        'cpuinfoapp',
72        'cpuinfo_main.cpp',
73        'cpuinfo_utils.cpp',
74        peci_files,
75        cpp_args: boost_args + peci_flag,
76        dependencies: [
77            boost_dep,
78            sdbusplus_dep,
79            phosphor_logging_dep,
80            phosphor_dbus_interfaces_dep,
81            i2c_dep,
82            peci_dep,
83        ],
84        implicit_include_directories: false,
85        include_directories: root_inc,
86        install: true,
87    )
88endif
89
90if get_option('smbios-ipmi-blob').allowed()
91    subdir('smbios-ipmi-blobs')
92endif
93