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 | |
| 63 | if get_option('adc').enabled() |
| 64 | executable( |
| 65 | 'adcsensor', |
| 66 | 'ADCSensor.cpp', |
| 67 | 'ADCSensorMain.cpp', |
| 68 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 69 | default_deps, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 70 | gpiodcxx, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 71 | thresholds_dep, |
| 72 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 73 | ], |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 74 | cpp_args: uring_args, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 75 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 76 | ) |
| 77 | endif |
| 78 | |
Thu Nguyen | 255da6b | 2022-07-29 10:05:52 +0700 | [diff] [blame] | 79 | if get_option('intel-cpu').enabled() |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 80 | executable( |
Thu Nguyen | 255da6b | 2022-07-29 10:05:52 +0700 | [diff] [blame] | 81 | 'intelcpusensor', |
| 82 | 'IntelCPUSensorMain.cpp', |
| 83 | 'IntelCPUSensor.cpp', |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 84 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 85 | default_deps, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 86 | gpiodcxx, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 87 | thresholds_dep, |
| 88 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 89 | ], |
Andrew Jeffery | e73bd0a | 2023-01-25 10:39:57 +1030 | [diff] [blame] | 90 | include_directories: peci_incdirs, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 91 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 92 | ) |
| 93 | endif |
| 94 | |
| 95 | if get_option('exit-air').enabled() |
| 96 | executable( |
| 97 | 'exitairtempsensor', |
| 98 | 'ExitAirTempSensor.cpp', |
| 99 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 100 | default_deps, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 101 | thresholds_dep, |
| 102 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 103 | ], |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 104 | cpp_args: uring_args, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 105 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 106 | ) |
| 107 | endif |
| 108 | |
| 109 | if get_option('fan').enabled() |
| 110 | executable( |
| 111 | 'fansensor', |
| 112 | 'FanMain.cpp', |
| 113 | 'TachSensor.cpp', |
| 114 | 'PwmSensor.cpp', |
| 115 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 116 | default_deps, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 117 | gpiodcxx, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 118 | thresholds_dep, |
| 119 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 120 | ], |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 121 | cpp_args: uring_args, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 122 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 123 | ) |
| 124 | endif |
| 125 | |
| 126 | if get_option('hwmon-temp').enabled() |
| 127 | executable( |
| 128 | 'hwmontempsensor', |
| 129 | 'HwmonTempMain.cpp', |
| 130 | 'HwmonTempSensor.cpp', |
| 131 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 132 | default_deps, |
Zev Weiss | a1456c4 | 2022-07-18 16:59:35 -0700 | [diff] [blame] | 133 | devicemgmt_dep, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 134 | thresholds_dep, |
| 135 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 136 | ], |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 137 | cpp_args: uring_args, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 138 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 139 | ) |
| 140 | endif |
| 141 | |
| 142 | if get_option('intrusion').enabled() |
| 143 | executable( |
| 144 | 'intrusionsensor', |
| 145 | 'ChassisIntrusionSensor.cpp', |
| 146 | 'IntrusionSensorMain.cpp', |
| 147 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 148 | default_deps, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 149 | gpiodcxx, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 150 | i2c, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 151 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 152 | ], |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 153 | cpp_args: uring_args, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 154 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 155 | ) |
| 156 | endif |
| 157 | |
| 158 | if get_option('ipmb').enabled() |
| 159 | executable( |
| 160 | 'ipmbsensor', |
| 161 | 'IpmbSensor.cpp', |
Jayashree Dhanapal | 3746c55 | 2022-03-21 14:45:52 +0530 | [diff] [blame] | 162 | 'IpmbSDRSensor.cpp', |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 163 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 164 | default_deps, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 165 | thresholds_dep, |
| 166 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 167 | ], |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 168 | cpp_args: uring_args, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 169 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 170 | ) |
| 171 | endif |
| 172 | |
Ed Tanous | 49d12d8 | 2021-02-11 13:44:15 -0800 | [diff] [blame] | 173 | if get_option('mcu').enabled() |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 174 | executable( |
| 175 | 'mcutempsensor', |
| 176 | 'MCUTempSensor.cpp', |
| 177 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 178 | default_deps, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 179 | i2c, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 180 | thresholds_dep, |
| 181 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 182 | ], |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 183 | cpp_args: uring_args, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 184 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 185 | ) |
| 186 | endif |
| 187 | |
| 188 | if get_option('nvme').enabled() |
Andrew Jeffery | e3e3c97 | 2021-05-26 14:37:07 +0930 | [diff] [blame] | 189 | nvme_srcs = files('NVMeSensorMain.cpp', 'NVMeSensor.cpp') |
| 190 | nvme_srcs += files('NVMeBasicContext.cpp') |
Andrew Jeffery | e3e3c97 | 2021-05-26 14:37:07 +0930 | [diff] [blame] | 191 | |
Andrew Jeffery | 6f25e7e | 2021-05-24 12:52:53 +0930 | [diff] [blame] | 192 | nvme_deps = [ default_deps, i2c, thresholds_dep, utils_dep, threads ] |
| 193 | |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 194 | executable( |
| 195 | 'nvmesensor', |
Andrew Jeffery | e3e3c97 | 2021-05-26 14:37:07 +0930 | [diff] [blame] | 196 | sources: nvme_srcs, |
| 197 | dependencies: nvme_deps, |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 198 | cpp_args: uring_args, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 199 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 200 | ) |
| 201 | endif |
| 202 | |
Lei YU | 3a18b86 | 2021-02-05 13:55:08 +0800 | [diff] [blame] | 203 | if get_option('psu').enabled() |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 204 | executable( |
Lei YU | 3a18b86 | 2021-02-05 13:55:08 +0800 | [diff] [blame] | 205 | 'psusensor', |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 206 | 'PSUEvent.cpp', |
| 207 | 'PSUSensor.cpp', |
| 208 | 'PSUSensorMain.cpp', |
| 209 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 210 | default_deps, |
Matt Simmering | 786efb8 | 2023-01-18 14:09:21 -0800 | [diff] [blame] | 211 | devicemgmt_dep, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 212 | pwmsensor_dep, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 213 | thresholds_dep, |
| 214 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 215 | ], |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 216 | cpp_args: uring_args, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 217 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 218 | ) |
| 219 | endif |
| 220 | |
| 221 | if get_option('external').enabled() |
| 222 | executable( |
| 223 | 'externalsensor', |
| 224 | 'ExternalSensor.cpp', |
| 225 | 'ExternalSensorMain.cpp', |
| 226 | dependencies: [ |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 227 | default_deps, |
Patrick Williams | 8b8f606 | 2021-08-27 14:53:50 -0500 | [diff] [blame] | 228 | thresholds_dep, |
| 229 | utils_dep, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 230 | ], |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 231 | cpp_args: uring_args, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 232 | install: true, |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 233 | ) |
| 234 | endif |