Brad Bishop | 5906173 | 2019-10-07 15:48:37 -0400 | [diff] [blame] | 1 | project( |
| 2 | 'phosphor-hwmon', |
| 3 | 'cpp', |
| 4 | default_options: [ |
| 5 | 'warning_level=3', |
| 6 | 'werror=true', |
| 7 | 'cpp_std=c++17' |
| 8 | ], |
| 9 | license: 'Apache-2.0', |
| 10 | version: '1.0', |
| 11 | ) |
| 12 | |
| 13 | build_tests = get_option('tests') |
| 14 | |
| 15 | gmock = dependency('gmock') |
| 16 | gpioplus = dependency('gpioplus') |
| 17 | gtest = dependency('gtest', main: true) |
| 18 | phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces') |
| 19 | phosphor_logging = dependency('phosphor-logging') |
| 20 | sdbusplus = dependency('sdbusplus') |
| 21 | sdeventplus = dependency('sdeventplus') |
| 22 | stdplus = dependency('stdplus') |
Matt Spinler | 5e034af | 2020-06-24 15:21:53 -0500 | [diff] [blame] | 23 | fmt = dependency('fmt') |
Brad Bishop | 5906173 | 2019-10-07 15:48:37 -0400 | [diff] [blame] | 24 | threads = dependency('threads') |
| 25 | |
| 26 | conf = configuration_data() |
| 27 | conf.set_quoted('BUSNAME_PREFIX', get_option('busname-prefix')) |
| 28 | conf.set_quoted('SENSOR_ROOT', get_option('sensor-root')) |
| 29 | conf.set10('NEGATIVE_ERRNO_ON_FAIL', get_option('negative-errno-on-fail')) |
| 30 | conf.set10('UPDATE_FUNCTIONAL_ON_FAIL', get_option('update-functional-on-fail')) |
| 31 | |
| 32 | configure_file(output: 'config.h', configuration: conf) |
| 33 | |
| 34 | libaverage = static_library( |
| 35 | 'average', |
| 36 | 'average.cpp', |
| 37 | ) |
| 38 | |
| 39 | libfan_pwm = static_library( |
| 40 | 'fan_pwm', |
| 41 | 'fan_pwm.cpp', |
| 42 | ) |
| 43 | |
| 44 | libhwmon = static_library( |
| 45 | 'hwmon', |
| 46 | 'hwmon.cpp', |
| 47 | ) |
| 48 | |
| 49 | libhwmonio = static_library( |
| 50 | 'hwmonio', |
| 51 | 'hwmonio.cpp', |
| 52 | ) |
| 53 | |
| 54 | libsensor = static_library( |
| 55 | 'sensor', |
| 56 | 'sensor.cpp', |
| 57 | dependencies: [ |
| 58 | phosphor_dbus_interfaces, |
| 59 | phosphor_logging, |
| 60 | sdbusplus, |
| 61 | ], |
| 62 | link_with: [ |
| 63 | libhwmon, |
| 64 | ], |
| 65 | ) |
| 66 | |
| 67 | libsysfs = static_library( |
| 68 | 'sysfs', |
| 69 | 'sysfs.cpp', |
| 70 | dependencies: [ |
| 71 | sdbusplus, |
| 72 | ], |
| 73 | ) |
| 74 | |
| 75 | libhwmon_all = static_library( |
| 76 | 'hwmon_all', |
| 77 | 'env.cpp', |
| 78 | 'fan_speed.cpp', |
| 79 | 'gpio_handle.cpp', |
| 80 | 'mainloop.cpp', |
| 81 | 'sensorset.cpp', |
| 82 | dependencies: [ |
Matt Spinler | 5e034af | 2020-06-24 15:21:53 -0500 | [diff] [blame] | 83 | fmt, |
Brad Bishop | 5906173 | 2019-10-07 15:48:37 -0400 | [diff] [blame] | 84 | gpioplus, |
| 85 | phosphor_dbus_interfaces, |
| 86 | phosphor_logging, |
| 87 | ], |
| 88 | link_with: [ |
| 89 | libaverage, |
| 90 | libfan_pwm, |
| 91 | libhwmon, |
| 92 | libhwmonio, |
| 93 | libsensor, |
| 94 | libsysfs, |
| 95 | ], |
| 96 | ) |
| 97 | |
| 98 | executable( |
| 99 | 'phosphor-hwmon-readd', |
| 100 | 'readd.cpp', |
| 101 | dependencies: [ |
| 102 | sdeventplus, |
| 103 | ], |
| 104 | install: true, |
| 105 | link_with: [ |
| 106 | libhwmon_all, |
| 107 | ], |
| 108 | ) |
| 109 | |
| 110 | subdir('msl') |
| 111 | subdir('test') |
| 112 | subdir('tools') |