Andrew Jeffery | e73bd0a | 2023-01-25 10:39:57 +1030 | [diff] [blame] | 1 | conf_data = configuration_data() |
| 2 | conf_data.set10('VALIDATION_UNSECURE_FEATURE', get_option('validate-unsecure-feature').enabled()) |
| 3 | conf_data.set10('INSECURE_UNRESTRICTED_SENSOR_OVERRIDE', get_option('insecure-sensor-override').enabled()) |
| 4 | configure_file(input: 'dbus-sensor_config.h.in', |
| 5 | output: 'dbus-sensor_config.h', |
| 6 | configuration: conf_data) |
| 7 | |
| 8 | thresholds_a = static_library( |
| 9 | 'thresholds_a', |
| 10 | 'Thresholds.cpp', |
| 11 | dependencies: default_deps, |
| 12 | ) |
| 13 | |
| 14 | thresholds_dep = declare_dependency( |
| 15 | link_with: [ thresholds_a ], |
| 16 | dependencies: default_deps, |
| 17 | ) |
| 18 | |
| 19 | utils_a = static_library( |
| 20 | 'utils_a', |
| 21 | [ |
| 22 | 'FileHandle.cpp', |
| 23 | 'SensorPaths.cpp', |
| 24 | 'Utils.cpp', |
| 25 | ], |
| 26 | dependencies: default_deps, |
| 27 | ) |
| 28 | |
| 29 | utils_dep = declare_dependency( |
| 30 | link_with: [ utils_a ], |
| 31 | dependencies: [ sdbusplus ], |
| 32 | ) |
| 33 | |
| 34 | devicemgmt_a = static_library( |
| 35 | 'devicemgmt_a', |
| 36 | [ |
| 37 | 'DeviceMgmt.cpp', |
| 38 | ], |
| 39 | dependencies: default_deps, |
| 40 | ) |
| 41 | |
| 42 | devicemgmt_dep = declare_dependency( |
| 43 | link_with: [ devicemgmt_a ], |
| 44 | dependencies: default_deps, |
| 45 | ) |
| 46 | |
| 47 | pwmsensor_a = static_library( |
| 48 | 'pwmsensor_a', |
| 49 | 'PwmSensor.cpp', |
| 50 | dependencies: [ default_deps, thresholds_dep ], |
| 51 | ) |
| 52 | |
| 53 | pwmsensor_dep = declare_dependency( |
| 54 | link_with: [ pwmsensor_a ], |
| 55 | dependencies: [ default_deps, thresholds_dep ], |
| 56 | ) |
| 57 | |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 58 | peci_incdirs = [] |
| 59 | if not meson.get_compiler('cpp').has_header('linux/peci-ioctl.h') |
| 60 | peci_incdirs = ['../include'] |
| 61 | endif |
| 62 | |
Oleksandr Shulzhenko | 77141ac | 2023-03-14 14:52:36 +0100 | [diff] [blame] | 63 | if get_option('intel-cpu').enabled() |
| 64 | peci_dep = meson.get_compiler('cpp').find_library('libpeci', required : false) |
| 65 | if not peci_dep.found() |
| 66 | cmake = import('cmake') |
| 67 | opt = cmake.subproject_options() |
| 68 | opt.append_compile_args('c', '-Wno-pedantic') |
| 69 | peci_proj = cmake.subproject('libpeci', options : opt) |
| 70 | peci_dep = peci_proj.dependency('peci') |
| 71 | endif |
| 72 | endif |
| 73 | |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 74 | if get_option('adc').enabled() |
| 75 | executable( |
| 76 | 'adcsensor', |
| 77 | 'ADCSensor.cpp', |
| 78 | 'ADCSensorMain.cpp', |
| 79 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 80 | default_deps, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 81 | gpiodcxx, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 82 | thresholds_dep, |
| 83 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 84 | ], |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 85 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 86 | ) |
| 87 | endif |
| 88 | |
Thu Nguyen | 255da6b | 2022-07-29 10:05:52 +0700 | [diff] [blame] | 89 | if get_option('intel-cpu').enabled() |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 90 | executable( |
Thu Nguyen | 255da6b | 2022-07-29 10:05:52 +0700 | [diff] [blame] | 91 | 'intelcpusensor', |
| 92 | 'IntelCPUSensorMain.cpp', |
| 93 | 'IntelCPUSensor.cpp', |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 94 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 95 | default_deps, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 96 | gpiodcxx, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 97 | thresholds_dep, |
| 98 | utils_dep, |
Oleksandr Shulzhenko | 77141ac | 2023-03-14 14:52:36 +0100 | [diff] [blame] | 99 | peci_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 100 | ], |
Andrew Jeffery | e73bd0a | 2023-01-25 10:39:57 +1030 | [diff] [blame] | 101 | include_directories: peci_incdirs, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 102 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 103 | ) |
| 104 | endif |
| 105 | |
| 106 | if get_option('exit-air').enabled() |
| 107 | executable( |
| 108 | 'exitairtempsensor', |
| 109 | 'ExitAirTempSensor.cpp', |
| 110 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 111 | default_deps, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 112 | thresholds_dep, |
| 113 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 114 | ], |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 115 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 116 | ) |
| 117 | endif |
| 118 | |
| 119 | if get_option('fan').enabled() |
| 120 | executable( |
| 121 | 'fansensor', |
| 122 | 'FanMain.cpp', |
| 123 | 'TachSensor.cpp', |
| 124 | 'PwmSensor.cpp', |
| 125 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 126 | default_deps, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 127 | gpiodcxx, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 128 | thresholds_dep, |
| 129 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 130 | ], |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 131 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 132 | ) |
| 133 | endif |
| 134 | |
| 135 | if get_option('hwmon-temp').enabled() |
| 136 | executable( |
| 137 | 'hwmontempsensor', |
| 138 | 'HwmonTempMain.cpp', |
| 139 | 'HwmonTempSensor.cpp', |
| 140 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 141 | default_deps, |
Zev Weiss | a1456c4 | 2022-07-18 16:59:35 -0700 | [diff] [blame] | 142 | devicemgmt_dep, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 143 | thresholds_dep, |
| 144 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 145 | ], |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 146 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 147 | ) |
| 148 | endif |
| 149 | |
| 150 | if get_option('intrusion').enabled() |
| 151 | executable( |
| 152 | 'intrusionsensor', |
| 153 | 'ChassisIntrusionSensor.cpp', |
| 154 | 'IntrusionSensorMain.cpp', |
| 155 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 156 | default_deps, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 157 | gpiodcxx, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 158 | i2c, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 159 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 160 | ], |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 161 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 162 | ) |
| 163 | endif |
| 164 | |
| 165 | if get_option('ipmb').enabled() |
| 166 | executable( |
| 167 | 'ipmbsensor', |
| 168 | 'IpmbSensor.cpp', |
Jayashree Dhanapal | 3746c55 | 2022-03-21 14:45:52 +0530 | [diff] [blame] | 169 | 'IpmbSDRSensor.cpp', |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 170 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 171 | default_deps, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 172 | thresholds_dep, |
| 173 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 174 | ], |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 175 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 176 | ) |
| 177 | endif |
| 178 | |
Ed Tanous | 49d12d8 | 2021-02-11 13:44:15 -0800 | [diff] [blame] | 179 | if get_option('mcu').enabled() |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 180 | executable( |
| 181 | 'mcutempsensor', |
| 182 | 'MCUTempSensor.cpp', |
| 183 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 184 | default_deps, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 185 | i2c, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 186 | thresholds_dep, |
| 187 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 188 | ], |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 189 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 190 | ) |
| 191 | endif |
| 192 | |
| 193 | if get_option('nvme').enabled() |
Andrew Jeffery | e3e3c97 | 2021-05-26 14:37:07 +0930 | [diff] [blame] | 194 | nvme_srcs = files('NVMeSensorMain.cpp', 'NVMeSensor.cpp') |
| 195 | nvme_srcs += files('NVMeBasicContext.cpp') |
Andrew Jeffery | e3e3c97 | 2021-05-26 14:37:07 +0930 | [diff] [blame] | 196 | |
Andrew Jeffery | 6f25e7e | 2021-05-24 12:52:53 +0930 | [diff] [blame] | 197 | nvme_deps = [ default_deps, i2c, thresholds_dep, utils_dep, threads ] |
| 198 | |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 199 | executable( |
| 200 | 'nvmesensor', |
Andrew Jeffery | e3e3c97 | 2021-05-26 14:37:07 +0930 | [diff] [blame] | 201 | sources: nvme_srcs, |
| 202 | dependencies: nvme_deps, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 203 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 204 | ) |
| 205 | endif |
| 206 | |
Lei YU | 3a18b86 | 2021-02-05 13:55:08 +0800 | [diff] [blame] | 207 | if get_option('psu').enabled() |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 208 | executable( |
Lei YU | 3a18b86 | 2021-02-05 13:55:08 +0800 | [diff] [blame] | 209 | 'psusensor', |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 210 | 'PSUEvent.cpp', |
| 211 | 'PSUSensor.cpp', |
| 212 | 'PSUSensorMain.cpp', |
| 213 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 214 | default_deps, |
Matt Simmering | 786efb8 | 2023-01-18 14:09:21 -0800 | [diff] [blame] | 215 | devicemgmt_dep, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 216 | pwmsensor_dep, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 217 | thresholds_dep, |
| 218 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 219 | ], |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 220 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 221 | ) |
| 222 | endif |
| 223 | |
| 224 | if get_option('external').enabled() |
| 225 | executable( |
| 226 | 'externalsensor', |
| 227 | 'ExternalSensor.cpp', |
| 228 | 'ExternalSensorMain.cpp', |
| 229 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 230 | default_deps, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 231 | thresholds_dep, |
| 232 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 233 | ], |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 234 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 235 | ) |
| 236 | endif |