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