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