Brad Bishop | b445991 | 2019-11-05 19:39:11 -0500 | [diff] [blame] | 1 | project( |
| 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 | |
| 13 | boost_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 | ] |
| 20 | build_tests = get_option('tests') |
Brad Bishop | e3a12b6 | 2020-01-15 11:56:29 -0500 | [diff] [blame] | 21 | cpp = meson.get_compiler('cpp') |
Brad Bishop | 787e828 | 2020-01-15 12:16:53 -0500 | [diff] [blame] | 22 | boost = dependency('boost', required: false) |
| 23 | if not boost.found() |
| 24 | subproject('boost', required: false) |
| 25 | boost = declare_dependency( |
| 26 | include_directories: 'subprojects/boost_1_71_0', |
| 27 | ) |
| 28 | endif |
Brad Bishop | 92daaaa | 2020-01-20 15:45:01 -0500 | [diff] [blame] | 29 | if get_option('fru-device') |
| 30 | i2c = cpp.find_library('i2c') |
| 31 | endif |
Brad Bishop | 79a09a8 | 2020-01-15 12:23:07 -0500 | [diff] [blame] | 32 | if cpp.has_header('nlohmann/json.hpp') |
| 33 | nlohmann_json = declare_dependency() |
| 34 | else |
| 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 | ) |
| 42 | endif |
Brad Bishop | 6765d90 | 2020-01-15 12:31:41 -0500 | [diff] [blame] | 43 | sdbusplus = dependency('sdbusplus', required: false) |
| 44 | if not sdbusplus.found() |
Patrick Williams | 7f5a336 | 2020-06-01 09:30:47 -0500 | [diff] [blame] | 45 | sdbusplus_proj = subproject('sdbusplus', required: true) |
| 46 | sdbusplus = sdbusplus_proj.get_variable('sdbusplus_dep') |
Brad Bishop | 6765d90 | 2020-01-15 12:31:41 -0500 | [diff] [blame] | 47 | endif |
Brad Bishop | b445991 | 2019-11-05 19:39:11 -0500 | [diff] [blame] | 48 | systemd = dependency('systemd') |
| 49 | systemd_system_unit_dir = systemd.get_pkgconfig_variable( |
| 50 | 'systemdsystemunitdir', |
| 51 | define_variable: ['prefix', get_option('prefix')]) |
| 52 | packagedir = join_paths( |
| 53 | get_option('prefix'), |
| 54 | get_option('datadir'), |
| 55 | meson.project_name(), |
| 56 | ) |
| 57 | threads = dependency('threads') |
Brad Bishop | ff1ddb7 | 2020-01-15 12:24:56 -0500 | [diff] [blame] | 58 | if cpp.has_header('valijson/validator.hpp') |
| 59 | valijson = declare_dependency() |
| 60 | else |
| 61 | subproject('valijson', required: false) |
| 62 | valijson = declare_dependency( |
| 63 | include_directories: 'subprojects/valijson/include' |
| 64 | ) |
| 65 | endif |
Brad Bishop | b445991 | 2019-11-05 19:39:11 -0500 | [diff] [blame] | 66 | |
| 67 | install_data('blacklist.json') |
| 68 | |
| 69 | configs = [ |
| 70 | '1Ux16 Riser.json', |
| 71 | '2Ux8 Riser.json', |
| 72 | '8X25 HSBP.json', |
| 73 | 'A2UL16RISER.json', |
| 74 | 'A2UX8X4RISER.json', |
| 75 | 'AHW1UM2RISER.json', |
Andrei Kartashev | b32e00d | 2020-09-11 22:40:38 +0300 | [diff] [blame] | 76 | 'ASPOWER_U1A-D10550_PSU.json', |
| 77 | 'ASPOWER_U1A-D10800_PSU.json', |
| 78 | 'ASPOWER_U1A-D11200_PSU.json', |
| 79 | 'ASPOWER_U1A-D11600_PSU.json', |
| 80 | 'ASPOWER_U1D-D10800_PSU.json', |
Brad Bishop | b445991 | 2019-11-05 19:39:11 -0500 | [diff] [blame] | 81 | 'AXX1P100HSSI_AIC.json', |
| 82 | 'AXX2PRTHDHD.json', |
| 83 | 'BNP Baseboard.json', |
| 84 | 'Delta DPS-750XB PSU.json', |
Andrei Kartashev | b32e00d | 2020-09-11 22:40:38 +0300 | [diff] [blame] | 85 | 'Delta_DPS-1600AB_PSU.json', |
| 86 | 'Delta_DPS-2000AB_PSU.json', |
Brad Bishop | b445991 | 2019-11-05 19:39:11 -0500 | [diff] [blame] | 87 | 'F1U12X25 HSBP.json', |
| 88 | 'F1U4X25 HSBP.json', |
| 89 | 'F2U12X35 HSBP.json', |
| 90 | 'F2U8X25 HSBP.json', |
| 91 | 'FBTP.json', |
| 92 | 'FBYV2.json', |
| 93 | 'Flextronics S-1100ADU00-201 PSU.json', |
| 94 | 'Intel Front Panel.json', |
| 95 | 'NVME P4000.json', |
| 96 | 'PCIE SSD Retimer.json', |
| 97 | 'PSSF132202A.json', |
| 98 | 'PSSF162205A.json', |
| 99 | 'PSSF212201A.json', |
| 100 | 'PSSF222201A.json', |
| 101 | 'R1000 Chassis.json', |
| 102 | 'R2000 Chassis.json', |
| 103 | 'SAS Module.json', |
| 104 | 'SOLUM_PSSF162202_PSU.json', |
| 105 | 'STP Baseboard.json', |
| 106 | 'STP P4000 Chassis.json', |
| 107 | 'WFT Baseboard.json', |
| 108 | ] |
| 109 | |
| 110 | foreach c : configs |
| 111 | install_data( |
| 112 | join_paths('configurations', c), |
| 113 | install_dir: join_paths( |
| 114 | packagedir, |
| 115 | 'configurations', |
| 116 | ) |
| 117 | ) |
| 118 | endforeach |
| 119 | |
| 120 | schemas = [ |
| 121 | 'global.json', |
Brad Bishop | 6666588 | 2020-05-07 17:05:18 -0400 | [diff] [blame] | 122 | 'legacy.json', |
Brad Bishop | b980991 | 2020-05-07 17:15:31 -0400 | [diff] [blame] | 123 | 'openbmc-dbus.json', |
Brad Bishop | 4afe708 | 2020-10-01 09:59:26 -0400 | [diff] [blame^] | 124 | 'IBM.json', |
Brad Bishop | b445991 | 2019-11-05 19:39:11 -0500 | [diff] [blame] | 125 | 'Pid.json', |
| 126 | 'Pid.Zone.json', |
| 127 | 'Stepwise.json', |
| 128 | ] |
| 129 | |
| 130 | foreach s : schemas |
| 131 | install_data( |
| 132 | join_paths('schemas', s), |
| 133 | install_dir: join_paths( |
| 134 | packagedir, |
| 135 | 'configurations', |
| 136 | 'schemas', |
| 137 | ) |
| 138 | ) |
| 139 | endforeach |
| 140 | |
| 141 | subdir('service_files') |
| 142 | subdir('src') |
Jason M. Bills | ff58eba | 2020-04-14 16:05:30 -0700 | [diff] [blame] | 143 | if not build_tests.disabled() |
| 144 | subdir('test') |
| 145 | endif |