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