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