xref: /openbmc/pldm/meson.build (revision 579a34a3)
1project('pldm', ['c', 'cpp'],
2        version: '0.1', meson_version: '>=0.53.2',
3        default_options: [
4          'warning_level=3',
5          'default_library=shared',
6          'werror=true',
7          'cpp_std=c++17'
8        ])
9
10# Wno-psabi reduces the number of "Note:" messages when cross-compiling some STL
11# stuff for ARM. See https://stackoverflow.com/questions/48149323/strange-gcc-warning-when-compiling-qt-project
12# Basically, gcc 6 and gcc 7 are not ABI compatible, but since the whole OpenBMC
13# project uses the same compiler, we can safely ignmore these info notes.
14add_project_arguments('-Wno-psabi', language: 'cpp')
15
16conf_data = configuration_data()
17conf_data.set_quoted('BIOS_JSONS_DIR', '/usr/share/pldm/bios')
18conf_data.set_quoted('BIOS_TABLES_DIR', '/var/lib/pldm/bios')
19conf_data.set_quoted('PDR_JSONS_DIR', '/usr/share/pldm/pdr')
20conf_data.set_quoted('FRU_JSONS_DIR', '/usr/share/pldm/fru')
21conf_data.set_quoted('HOST_JSONS_DIR', '/usr/share/pldm/host')
22conf_data.set_quoted('EVENTS_JSONS_DIR', '/usr/share/pldm/events')
23if get_option('oem-ibm').enabled()
24  conf_data.set_quoted('FILE_TABLE_JSON', '/usr/share/pldm/fileTable.json')
25  conf_data.set_quoted('LID_PERM_DIR', '/usr/share/host-fw')
26  conf_data.set_quoted('LID_TEMP_DIR', '/usr/share/host-fw')
27  conf_data.set('DMA_MAXSIZE', get_option('oem-ibm-dma-maxsize'))
28  add_global_arguments('-DOEM_IBM', language : 'c')
29  add_global_arguments('-DOEM_IBM', language : 'cpp')
30endif
31configure_file(output: 'config.h',
32  configuration: conf_data
33)
34
35subdir('libpldm')
36
37if get_option('libpldm-only').disabled()
38
39libpldmutils_headers = ['.']
40libpldmutils = library(
41  'pldmutils',
42  'common/utils.cpp',
43  version: meson.project_version(),
44  dependencies: [
45      libpldm,
46      dependency('phosphor-dbus-interfaces'),
47      dependency('sdbusplus'),
48  ],
49  install: true,
50  include_directories: include_directories(libpldmutils_headers),
51)
52
53libpldmutils = declare_dependency(
54  include_directories: include_directories(libpldmutils_headers),
55  link_with: libpldmutils)
56subdir('libpldmresponder')
57
58deps = [
59  libpldm,
60  libpldmutils,
61  libpldmresponder,
62  libpldmutils,
63  dependency('sdbusplus'),
64  dependency('sdeventplus'),
65  dependency('phosphor-dbus-interfaces')
66]
67
68executable(
69  'pldmd',
70  'pldmd/pldmd.cpp',
71  'pldmd/dbus_impl_requester.cpp',
72  'pldmd/instance_id.cpp',
73  'pldmd/dbus_impl_pdr.cpp',
74  'host-bmc/dbus_to_host_effecters.cpp',
75  implicit_include_directories: false,
76  dependencies: deps,
77  install: true,
78  install_dir: get_option('bindir'))
79
80systemd = dependency('systemd')
81systemd_system_unit_dir = systemd.get_pkgconfig_variable(
82    'systemdsystemunitdir',
83    define_variable: ['prefix', get_option('prefix')])
84configure_file(
85  copy: true,
86  input: 'pldmd/pldmd.service',
87  install: true,
88  install_dir: systemd_system_unit_dir,
89  output: 'pldmd.service',
90)
91
92subdir('pldmtool')
93
94subdir('configurations')
95
96if get_option('tests').enabled()
97  subdir('test')
98endif
99
100if get_option('utilities').enabled()
101  subdir('utilities')
102endif
103
104endif # pldm-only
105