blob: d94397e52af08b779274bdbe372ee89596cc5e4b [file] [log] [blame]
Jonathan Doman366546c2023-07-24 12:33:16 -07001cpp_args_smbios = boost_args
2if get_option('dimm-dbus').allowed()
Patrick Williams9d583912025-02-01 08:37:58 -05003 cpp_args_smbios += ['-DDIMM_DBUS']
Jonathan Doman366546c2023-07-24 12:33:16 -07004endif
5
Josh Lehanabdccd32024-01-26 15:49:50 -08006if get_option('assoc-trim-path').allowed()
Patrick Williams9d583912025-02-01 08:37:58 -05007 cpp_args_smbios += ['-DASSOC_TRIM_PATH']
Josh Lehanabdccd32024-01-26 15:49:50 -08008endif
9
Jonathan Doman366546c2023-07-24 12:33:16 -070010if get_option('dimm-only-locator').allowed()
Patrick Williams9d583912025-02-01 08:37:58 -050011 cpp_args_smbios += ['-DDIMM_ONLY_LOCATOR']
Jonathan Doman366546c2023-07-24 12:33:16 -070012endif
13
Manojkiran Edace89a372025-02-05 23:09:04 +053014if get_option('slot-drive-presence').allowed()
15 cpp_args_smbios += ['-DSLOT_DRIVE_PRESENCE']
16endif
17
Prithvi Pai5af42bb2025-02-11 17:59:07 +053018if get_option('tpm-dbus').allowed()
19 cpp_args_smbios += ['-DTPM_DBUS']
20endif
21
Prithvi Pai6f9e7a72025-03-14 13:05:02 +053022if 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
Jonathan Doman366546c2023-07-24 12:33:16 -070030executable(
Patrick Williams9d583912025-02-01 08:37:58 -050031 'smbiosmdrv2app',
32 'mdrv2.cpp',
33 'mdrv2_main.cpp',
34 'cpu.cpp',
35 'dimm.cpp',
36 'system.cpp',
37 'pcieslot.cpp',
Prithvi Pai5af42bb2025-02-11 17:59:07 +053038 'tpm.cpp',
Prithvi Pai6f9e7a72025-03-14 13:05:02 +053039 'firmware_inventory.cpp',
Patrick Williams9d583912025-02-01 08:37:58 -050040 cpp_args: cpp_args_smbios,
Jonathan Doman366546c2023-07-24 12:33:16 -070041 dependencies: [
Patrick Williams9d583912025-02-01 08:37:58 -050042 boost_dep,
43 sdbusplus_dep,
44 phosphor_logging_dep,
45 phosphor_dbus_interfaces_dep,
Jonathan Doman366546c2023-07-24 12:33:16 -070046 ],
47 implicit_include_directories: false,
48 include_directories: root_inc,
49 install: true,
Patrick Williams9d583912025-02-01 08:37:58 -050050)
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 )
Jonathan Doman366546c2023-07-24 12:33:16 -070084endif
85
86if get_option('smbios-ipmi-blob').allowed()
Patrick Williams9d583912025-02-01 08:37:58 -050087 subdir('smbios-ipmi-blobs')
Jonathan Doman366546c2023-07-24 12:33:16 -070088endif