| conf_data = configuration_data() |
| conf_data.set10('VALIDATION_UNSECURE_FEATURE', get_option('validate-unsecure-feature').enabled()) |
| conf_data.set10('INSECURE_UNRESTRICTED_SENSOR_OVERRIDE', get_option('insecure-sensor-override').enabled()) |
| conf_data.set10('NVMED_ENABLE_SINGLE_WOKER', get_option('single-worker').enabled()) |
| conf_hdr = configure_file(input: 'dbus-sensor_config.h.in', |
| output: 'dbus-sensor_config.h', |
| configuration: conf_data) |
| |
| thresholds_a = static_library( |
| 'thresholds_a', |
| 'Thresholds.cpp', |
| dependencies: default_deps, |
| ) |
| |
| thresholds_dep = declare_dependency( |
| link_with: [ thresholds_a ], |
| dependencies: default_deps, |
| ) |
| |
| utils_a = static_library( |
| 'utils_a', |
| [ |
| 'FileHandle.cpp', |
| 'SensorPaths.cpp', |
| 'Utils.cpp', |
| ], |
| dependencies: default_deps, |
| ) |
| |
| utils_dep = declare_dependency( |
| link_with: [ utils_a ], |
| dependencies: [ sdbusplus, systemd ], |
| ) |
| |
| devicemgmt_a = static_library( |
| 'devicemgmt_a', |
| [ |
| 'DeviceMgmt.cpp', |
| ], |
| dependencies: default_deps, |
| ) |
| |
| devicemgmt_dep = declare_dependency( |
| link_with: [ devicemgmt_a ], |
| dependencies: default_deps, |
| ) |
| |
| pwmsensor_a = static_library( |
| 'pwmsensor_a', |
| 'PwmSensor.cpp', |
| dependencies: [ default_deps, thresholds_dep ], |
| ) |
| |
| pwmsensor_dep = declare_dependency( |
| link_with: [ pwmsensor_a ], |
| dependencies: [ default_deps, thresholds_dep ], |
| ) |
| |
| peci_incdirs = [] |
| if not meson.get_compiler('cpp').has_header('linux/peci-ioctl.h') |
| peci_incdirs = ['../include'] |
| endif |
| |
| if get_option('intel-cpu').enabled() |
| peci_dep = meson.get_compiler('cpp').find_library('libpeci', required : false) |
| if not peci_dep.found() |
| cmake = import('cmake') |
| opt = cmake.subproject_options() |
| opt.append_compile_args('c', '-Wno-pedantic') |
| peci_proj = cmake.subproject('libpeci', options : opt) |
| peci_dep = peci_proj.dependency('peci') |
| endif |
| endif |
| |
| if get_option('adc').enabled() |
| executable( |
| 'adcsensor', |
| 'ADCSensor.cpp', |
| 'ADCSensorMain.cpp', |
| dependencies: [ |
| default_deps, |
| gpiodcxx, |
| thresholds_dep, |
| utils_dep, |
| ], |
| install: true, |
| ) |
| endif |
| |
| if get_option('intel-cpu').enabled() |
| executable( |
| 'intelcpusensor', |
| 'IntelCPUSensorMain.cpp', |
| 'IntelCPUSensor.cpp', |
| dependencies: [ |
| default_deps, |
| gpiodcxx, |
| thresholds_dep, |
| utils_dep, |
| peci_dep, |
| ], |
| include_directories: peci_incdirs, |
| install: true, |
| ) |
| endif |
| |
| if get_option('exit-air').enabled() |
| executable( |
| 'exitairtempsensor', |
| 'ExitAirTempSensor.cpp', |
| dependencies: [ |
| default_deps, |
| thresholds_dep, |
| utils_dep, |
| ], |
| install: true, |
| ) |
| endif |
| |
| if get_option('fan').enabled() |
| executable( |
| 'fansensor', |
| 'FanMain.cpp', |
| 'TachSensor.cpp', |
| 'PwmSensor.cpp', |
| dependencies: [ |
| default_deps, |
| gpiodcxx, |
| thresholds_dep, |
| utils_dep, |
| ], |
| install: true, |
| ) |
| endif |
| |
| if get_option('hwmon-temp').enabled() |
| executable( |
| 'hwmontempsensor', |
| 'HwmonTempMain.cpp', |
| 'HwmonTempSensor.cpp', |
| dependencies: [ |
| default_deps, |
| devicemgmt_dep, |
| thresholds_dep, |
| utils_dep, |
| ], |
| install: true, |
| ) |
| endif |
| |
| if get_option('intrusion').enabled() |
| executable( |
| 'intrusionsensor', |
| 'ChassisIntrusionSensor.cpp', |
| 'IntrusionSensorMain.cpp', |
| dependencies: [ |
| default_deps, |
| gpiodcxx, |
| i2c, |
| utils_dep, |
| ], |
| install: true, |
| ) |
| endif |
| |
| if get_option('ipmb').enabled() |
| executable( |
| 'ipmbsensor', |
| 'IpmbSensor.cpp', |
| 'IpmbSDRSensor.cpp', |
| dependencies: [ |
| default_deps, |
| thresholds_dep, |
| utils_dep, |
| ], |
| install: true, |
| ) |
| endif |
| |
| if get_option('mcu').enabled() |
| executable( |
| 'mcutempsensor', |
| 'MCUTempSensor.cpp', |
| dependencies: [ |
| default_deps, |
| i2c, |
| thresholds_dep, |
| utils_dep, |
| ], |
| install: true, |
| ) |
| endif |
| |
| if get_option('nvme').enabled() |
| nvme_srcs = files( |
| 'MctpEndpoint.cpp', |
| 'NVMeSensorMain.cpp', |
| 'NVMeSensor.cpp', |
| 'NVMeBasic.cpp', |
| 'NVMeSubsys.cpp', |
| 'NVMeMi.cpp', |
| 'NVMeController.cpp', |
| 'NVMeProgress.cpp', |
| 'NVMeVolume.cpp', |
| 'NVMeDrive.cpp', |
| 'NVMeError.cpp', |
| 'NVMeStorage.cpp', |
| 'NVMePlugin.cpp', |
| 'NVMeMetricStore.cpp', |
| ) |
| |
| pdi_dep = phosphor_dbus_interfaces_dep |
| libnvme = dependency('libnvme', |
| required : true, |
| fallback : ['libnvme', 'libnvme_dep'], |
| include_type: 'system' |
| ) |
| libnvme_mi = dependency('libnvme-mi', |
| required : true, |
| fallback : ['libnvme', 'libnvme_mi_dep'], |
| include_type: 'system' |
| ) |
| |
| nvme_deps = [ |
| default_deps, i2c, thresholds_dep, utils_dep, |
| threads, pdi_dep, libnvme, libnvme_mi, |
| nvme_dbus_dep |
| ] |
| |
| cxx = meson.get_compiler('cpp') |
| |
| executable( |
| 'nvmesensor', |
| sources: nvme_srcs, |
| dependencies: nvme_deps, |
| cpp_args: [ |
| '-frtti', |
| '-DBOOST_ASIO_DISABLE_EPOLL', |
| '-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT', |
| '-UBOOST_ASIO_NO_DEPRECATED', |
| '-UBOOST_ASIO_DISABLE_THREADS', |
| '-UBOOST_ASIO_HAS_IO_URING' |
| ], |
| link_args: cxx.get_id() == 'clang' ? ['-rdynamic'] : ['-export-dynamic'], |
| install: true, |
| include_directories: nvme_dbus_includes, |
| ) |
| |
| nvme_plugin_inc = include_directories('./') |
| |
| nvme_plugin_dep = declare_dependency( |
| include_directories: nvme_plugin_inc, |
| dependencies: [nvme_dbus_dep, pdi_dep, libnvme_mi], |
| ) |
| |
| pkgconfig = import('pkgconfig') |
| pkgconfig.generate( |
| name: 'nvme-plugin', |
| version: meson.project_version(), |
| description: 'nvmed plugin package', |
| subdirs: ['.', 'gen', 'nvmed'] |
| ) |
| |
| install_headers( |
| 'Utils.hpp', |
| 'NVMePlugin.hpp', |
| 'NVMeUtil.hpp', |
| 'VariantVisitors.hpp', |
| conf_hdr, |
| 'SensorPaths.hpp', |
| 'Thresholds.hpp', |
| 'sensor.hpp', |
| 'NVMeSensor.hpp', |
| 'NVMeCache.hpp', |
| 'NVMeMetricStore.hpp', |
| subdir: 'nvmed' |
| ) |
| |
| endif |
| |
| if get_option('psu').enabled() |
| executable( |
| 'psusensor', |
| 'PSUEvent.cpp', |
| 'PSUSensor.cpp', |
| 'PSUSensorMain.cpp', |
| dependencies: [ |
| default_deps, |
| devicemgmt_dep, |
| pwmsensor_dep, |
| thresholds_dep, |
| utils_dep, |
| ], |
| install: true, |
| ) |
| endif |
| |
| if get_option('external').enabled() |
| executable( |
| 'externalsensor', |
| 'ExternalSensor.cpp', |
| 'ExternalSensorMain.cpp', |
| dependencies: [ |
| default_deps, |
| thresholds_dep, |
| utils_dep, |
| ], |
| install: true, |
| ) |
| endif |