blob: 66e6801615c96d755689f3c1eb25dc64719204e3 [file] [log] [blame]
Brad Bishop59061732019-10-07 15:48:37 -04001project(
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')
Matt Spinler5e034af2020-06-24 15:21:53 -050023fmt = dependency('fmt')
Brad Bishop59061732019-10-07 15:48:37 -040024threads = dependency('threads')
25
26conf = configuration_data()
27conf.set_quoted('BUSNAME_PREFIX', get_option('busname-prefix'))
28conf.set_quoted('SENSOR_ROOT', get_option('sensor-root'))
29conf.set10('NEGATIVE_ERRNO_ON_FAIL', get_option('negative-errno-on-fail'))
30conf.set10('UPDATE_FUNCTIONAL_ON_FAIL', get_option('update-functional-on-fail'))
31
32configure_file(output: 'config.h', configuration: conf)
33
34libaverage = static_library(
35 'average',
36 'average.cpp',
37)
38
39libfan_pwm = static_library(
40 'fan_pwm',
41 'fan_pwm.cpp',
42)
43
44libhwmon = static_library(
45 'hwmon',
46 'hwmon.cpp',
47)
48
49libhwmonio = static_library(
50 'hwmonio',
51 'hwmonio.cpp',
52)
53
54libsensor = 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
67libsysfs = static_library(
68 'sysfs',
69 'sysfs.cpp',
70 dependencies: [
71 sdbusplus,
72 ],
73)
74
75libhwmon_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 Spinler5e034af2020-06-24 15:21:53 -050083 fmt,
Brad Bishop59061732019-10-07 15:48:37 -040084 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
98executable(
99 'phosphor-hwmon-readd',
100 'readd.cpp',
101 dependencies: [
102 sdeventplus,
103 ],
104 install: true,
105 link_with: [
106 libhwmon_all,
107 ],
108)
109
110subdir('msl')
111subdir('test')
112subdir('tools')