xref: /openbmc/entity-manager/meson.build (revision 92daaaa3)
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    subproject('sdbusplus', required: false)
46    run_command(find_program('build-sdbusplus.sh'), check: true)
47    sdbusplus = declare_dependency(
48        dependencies: dependency('libsystemd'),
49        include_directories: 'sdbusplus',
50        link_args: [
51            'sdbusplus/.libs/libsdbusplus.so',
52            '-Wl,-rpath,$ORIGIN/../sdbusplus/.libs'
53        ],
54    )
55endif
56systemd = dependency('systemd')
57systemd_system_unit_dir = systemd.get_pkgconfig_variable(
58    'systemdsystemunitdir',
59    define_variable: ['prefix', get_option('prefix')])
60packagedir = join_paths(
61    get_option('prefix'),
62    get_option('datadir'),
63    meson.project_name(),
64)
65threads = dependency('threads')
66if cpp.has_header('valijson/validator.hpp')
67    valijson = declare_dependency()
68else
69    subproject('valijson', required: false)
70    valijson = declare_dependency(
71        include_directories: 'subprojects/valijson/include'
72    )
73endif
74
75install_data('blacklist.json')
76
77configs = [
78    '1Ux16 Riser.json',
79    '2Ux8 Riser.json',
80    '8X25 HSBP.json',
81    'A2UL16RISER.json',
82    'A2UX8X4RISER.json',
83    'AHW1UM2RISER.json',
84    'AXX1P100HSSI_AIC.json',
85    'AXX2PRTHDHD.json',
86    'BNP Baseboard.json',
87    'Delta DPS-750XB PSU.json',
88    'F1U12X25 HSBP.json',
89    'F1U4X25 HSBP.json',
90    'F2U12X35 HSBP.json',
91    'F2U8X25 HSBP.json',
92    'FBTP.json',
93    'FBYV2.json',
94    'Flextronics S-1100ADU00-201 PSU.json',
95    'Intel Front Panel.json',
96    'NVME P4000.json',
97    'PCIE SSD Retimer.json',
98    'PSSF132202A.json',
99    'PSSF162205A.json',
100    'PSSF212201A.json',
101    'PSSF222201A.json',
102    'R1000 Chassis.json',
103    'R2000 Chassis.json',
104    'SAS Module.json',
105    'SOLUM_PSSF162202_PSU.json',
106    'STP Baseboard.json',
107    'STP P4000 Chassis.json',
108    'WFT Baseboard.json',
109]
110
111foreach c : configs
112    install_data(
113        join_paths('configurations', c),
114        install_dir: join_paths(
115            packagedir,
116            'configurations',
117        )
118    )
119endforeach
120
121schemas = [
122    'global.json',
123    'Pid.json',
124    'Pid.Zone.json',
125    'Stepwise.json',
126]
127
128foreach s : schemas
129    install_data(
130        join_paths('schemas', s),
131        install_dir: join_paths(
132            packagedir,
133            'configurations',
134            'schemas',
135        )
136    )
137endforeach
138
139subdir('service_files')
140subdir('src')
141subdir('test')
142