blob: 19dfc62be166ca7303411e29addb126e5d11dda8 [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
Matt Spinler5e034af2020-06-24 15:21:53 -050015fmt = dependency('fmt')
William A. Kennington IIIf9aff802021-05-05 12:06:24 -070016gmock = dependency('gmock')
17gtest = dependency('gtest', main: true)
Brad Bishop59061732019-10-07 15:48:37 -040018
19conf = configuration_data()
20conf.set_quoted('BUSNAME_PREFIX', get_option('busname-prefix'))
21conf.set_quoted('SENSOR_ROOT', get_option('sensor-root'))
22conf.set10('NEGATIVE_ERRNO_ON_FAIL', get_option('negative-errno-on-fail'))
23conf.set10('UPDATE_FUNCTIONAL_ON_FAIL', get_option('update-functional-on-fail'))
24
William A. Kennington IIIf9aff802021-05-05 12:06:24 -070025sysfs_headers = include_directories('.')
Brad Bishop59061732019-10-07 15:48:37 -040026
William A. Kennington IIIf9aff802021-05-05 12:06:24 -070027sysfs_deps = [
28 fmt,
29]
Brad Bishop59061732019-10-07 15:48:37 -040030
William A. Kennington IIIf9aff802021-05-05 12:06:24 -070031sysfs_lib = static_library(
Brad Bishop59061732019-10-07 15:48:37 -040032 'sysfs',
33 'sysfs.cpp',
William A. Kennington IIIf9aff802021-05-05 12:06:24 -070034 include_directories: sysfs_headers,
35 dependencies: sysfs_deps)
Brad Bishop59061732019-10-07 15:48:37 -040036
William A. Kennington IIIf9aff802021-05-05 12:06:24 -070037sysfs_dep = declare_dependency(
38 dependencies: sysfs_deps,
39 include_directories: sysfs_headers,
40 link_with: sysfs_lib)
41
42hwmon_headers = include_directories('.')
43
44hwmon_deps = [
45 fmt,
46 dependency('gpioplus'),
47 dependency('phosphor-dbus-interfaces'),
48 dependency('phosphor-logging'),
49 dependency('sdbusplus'),
50 dependency('sdeventplus'),
51 dependency('stdplus'),
52 sysfs_dep,
53]
54
55hwmon_lib = static_library(
56 'hwmon',
57 'average.cpp',
58 configure_file(output: 'config.h', configuration: conf),
Brad Bishop59061732019-10-07 15:48:37 -040059 'env.cpp',
William A. Kennington IIIf9aff802021-05-05 12:06:24 -070060 'fan_pwm.cpp',
Brad Bishop59061732019-10-07 15:48:37 -040061 'fan_speed.cpp',
62 'gpio_handle.cpp',
William A. Kennington IIIf9aff802021-05-05 12:06:24 -070063 'hwmon.cpp',
64 'hwmonio.cpp',
Brad Bishop59061732019-10-07 15:48:37 -040065 'mainloop.cpp',
William A. Kennington IIIf9aff802021-05-05 12:06:24 -070066 'sensor.cpp',
Brad Bishop59061732019-10-07 15:48:37 -040067 'sensorset.cpp',
William A. Kennington IIIf9aff802021-05-05 12:06:24 -070068 dependencies: hwmon_deps,
69 include_directories: hwmon_headers)
70
71hwmon_dep = declare_dependency(
72 dependencies: hwmon_deps,
73 include_directories: hwmon_headers,
74 link_with: hwmon_lib)
Brad Bishop59061732019-10-07 15:48:37 -040075
76executable(
77 'phosphor-hwmon-readd',
78 'readd.cpp',
William A. Kennington IIIf9aff802021-05-05 12:06:24 -070079 dependencies: hwmon_dep,
Brad Bishop59061732019-10-07 15:48:37 -040080 install: true,
Brad Bishop59061732019-10-07 15:48:37 -040081)
82
83subdir('msl')
84subdir('test')
85subdir('tools')