xref: /openbmc/entity-manager/meson.build (revision b980991b)
1project(
2    'entity-manager',
3    'cpp',
4    default_options: [
5        'warning_level=3',
6        'werror=true',
7        'cpp_std=c++17'
8    ],
9    license: 'Apache-2.0',
10    version: '0.1',
11)
12
13boost_args = [
14    '-DBOOST_SYSTEM_NO_DEPRECATED',
15    '-DBOOST_ERROR_CODE_HEADER_ONLY',
16    '-DBOOST_NO_RTTI',
17    '-DBOOST_NO_TYPEID',
18    '-DBOOST_ALL_NO_LIB',
19]
20build_tests = get_option('tests')
21cpp = meson.get_compiler('cpp')
22boost = dependency('boost', required: false)
23if not boost.found()
24     subproject('boost', required: false)
25     boost = declare_dependency(
26         include_directories: 'subprojects/boost_1_71_0',
27     )
28endif
29if get_option('fru-device')
30    i2c = cpp.find_library('i2c')
31endif
32if cpp.has_header('nlohmann/json.hpp')
33    nlohmann_json = declare_dependency()
34else
35    subproject('nlohmann', required: false)
36    nlohmann_json = declare_dependency(
37        include_directories: [
38            'subprojects/nlohmann/single_include',
39            'subprojects/nlohmann/single_include/nlohmann',
40        ]
41    )
42endif
43sdbusplus = dependency('sdbusplus', required: false)
44if not sdbusplus.found()
45    sdbusplus_proj = subproject('sdbusplus', required: true)
46    sdbusplus = sdbusplus_proj.get_variable('sdbusplus_dep')
47endif
48systemd = dependency('systemd')
49systemd_system_unit_dir = systemd.get_pkgconfig_variable(
50    'systemdsystemunitdir',
51    define_variable: ['prefix', get_option('prefix')])
52packagedir = join_paths(
53    get_option('prefix'),
54    get_option('datadir'),
55    meson.project_name(),
56)
57threads = dependency('threads')
58if cpp.has_header('valijson/validator.hpp')
59    valijson = declare_dependency()
60else
61    subproject('valijson', required: false)
62    valijson = declare_dependency(
63        include_directories: 'subprojects/valijson/include'
64    )
65endif
66
67install_data('blacklist.json')
68
69configs = [
70    '1Ux16 Riser.json',
71    '2Ux8 Riser.json',
72    '8X25 HSBP.json',
73    'A2UL16RISER.json',
74    'A2UX8X4RISER.json',
75    'AHW1UM2RISER.json',
76    'AXX1P100HSSI_AIC.json',
77    'AXX2PRTHDHD.json',
78    'BNP Baseboard.json',
79    'Delta DPS-750XB PSU.json',
80    'F1U12X25 HSBP.json',
81    'F1U4X25 HSBP.json',
82    'F2U12X35 HSBP.json',
83    'F2U8X25 HSBP.json',
84    'FBTP.json',
85    'FBYV2.json',
86    'Flextronics S-1100ADU00-201 PSU.json',
87    'Intel Front Panel.json',
88    'NVME P4000.json',
89    'PCIE SSD Retimer.json',
90    'PSSF132202A.json',
91    'PSSF162205A.json',
92    'PSSF212201A.json',
93    'PSSF222201A.json',
94    'R1000 Chassis.json',
95    'R2000 Chassis.json',
96    'SAS Module.json',
97    'SOLUM_PSSF162202_PSU.json',
98    'STP Baseboard.json',
99    'STP P4000 Chassis.json',
100    'WFT Baseboard.json',
101]
102
103foreach c : configs
104    install_data(
105        join_paths('configurations', c),
106        install_dir: join_paths(
107            packagedir,
108            'configurations',
109        )
110    )
111endforeach
112
113schemas = [
114    'global.json',
115    'legacy.json',
116    'openbmc-dbus.json',
117    'Pid.json',
118    'Pid.Zone.json',
119    'Stepwise.json',
120]
121
122foreach s : schemas
123    install_data(
124        join_paths('schemas', s),
125        install_dir: join_paths(
126            packagedir,
127            'configurations',
128            'schemas',
129        )
130    )
131endforeach
132
133subdir('service_files')
134subdir('src')
135if not build_tests.disabled()
136  subdir('test')
137endif
138