xref: /openbmc/pldm/meson.build (revision dd04990d)
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('softoff').enabled()
24  conf_data.set('SOFTOFF_TIMEOUT_SECONDS', get_option('softoff-timeout-seconds'))
25endif
26if get_option('oem-ibm').enabled()
27  conf_data.set_quoted('FILE_TABLE_JSON', '/usr/share/pldm/fileTable.json')
28  conf_data.set_quoted('LID_RUNNING_DIR', '/var/lib/phosphor-software-manager/hostfw/running')
29  conf_data.set_quoted('LID_ALTERNATE_DIR', '/var/lib/phosphor-software-manager/hostfw/alternate')
30  conf_data.set_quoted('LID_RUNNING_PATCH_DIR', '/usr/local/share/hostfw/running')
31  conf_data.set_quoted('LID_ALTERNATE_PATCH_DIR', '/usr/local/share/hostfw/alternate')
32  conf_data.set('DMA_MAXSIZE', get_option('oem-ibm-dma-maxsize'))
33  add_global_arguments('-DOEM_IBM', language : 'c')
34  add_global_arguments('-DOEM_IBM', language : 'cpp')
35endif
36configure_file(output: 'config.h',
37  configuration: conf_data
38)
39
40subdir('libpldm')
41
42if get_option('libpldm-only').disabled()
43
44libpldmutils_headers = ['.']
45libpldmutils = library(
46  'pldmutils',
47  'common/utils.cpp',
48  version: meson.project_version(),
49  dependencies: [
50      libpldm,
51      dependency('phosphor-dbus-interfaces'),
52      dependency('sdbusplus'),
53  ],
54  install: true,
55  include_directories: include_directories(libpldmutils_headers),
56)
57
58libpldmutils = declare_dependency(
59  include_directories: include_directories(libpldmutils_headers),
60  link_with: libpldmutils)
61subdir('libpldmresponder')
62
63deps = [
64  libpldm,
65  libpldmutils,
66  libpldmresponder,
67  libpldmutils,
68  dependency('sdbusplus'),
69  dependency('sdeventplus'),
70  dependency('phosphor-dbus-interfaces')
71]
72
73executable(
74  'pldmd',
75  'pldmd/pldmd.cpp',
76  'pldmd/dbus_impl_requester.cpp',
77  'pldmd/instance_id.cpp',
78  'pldmd/dbus_impl_pdr.cpp',
79  'host-bmc/dbus_to_host_effecters.cpp',
80  implicit_include_directories: false,
81  dependencies: deps,
82  install: true,
83  install_dir: get_option('bindir'))
84
85systemd = dependency('systemd')
86systemd_system_unit_dir = systemd.get_pkgconfig_variable(
87    'systemdsystemunitdir',
88    define_variable: ['prefix', get_option('prefix')])
89configure_file(
90  copy: true,
91  input: 'pldmd/pldmd.service',
92  install: true,
93  install_dir: systemd_system_unit_dir,
94  output: 'pldmd.service',
95)
96
97subdir('pldmtool')
98
99subdir('configurations')
100
101if get_option('tests').enabled()
102  subdir('test')
103endif
104
105if get_option('utilities').enabled()
106  subdir('utilities')
107endif
108
109if get_option('softoff').enabled()
110  subdir('softoff')
111endif
112
113endif # pldm-only
114