blob: 211d855cd31639b1246abcf2b185a3eaaf408730 [file] [log] [blame]
Brad Bishopfeb19ef2019-11-07 18:02:16 -05001project(
2 'dbus-sensors',
3 'cpp',
4 default_options: [
5 'warning_level=3',
6 'werror=true',
Andrew Jefferyfbf92542021-05-27 15:00:47 +09307 'cpp_std=c++20'
Brad Bishopfeb19ef2019-11-07 18:02:16 -05008 ],
9 license: 'Apache-2.0',
10 version: '0.1',
Andrew Jefferyfbf92542021-05-27 15:00:47 +093011 meson_version: '>=0.57.0',
Brad Bishopfeb19ef2019-11-07 18:02:16 -050012)
13
14add_project_arguments(
15 '-DBOOST_SYSTEM_NO_DEPRECATED',
16 '-DBOOST_ERROR_CODE_HEADER_ONLY',
17 '-DBOOST_NO_RTTI',
18 '-DBOOST_NO_TYPEID',
19 '-DBOOST_ALL_NO_LIB',
20 '-DBOOST_ASIO_DISABLE_THREADS',
21 '-DBOOST_ALLOW_DEPRECATED_HEADERS',
22 language: 'cpp',
23)
24
25build_tests = get_option('tests')
Brad Bishopfeb19ef2019-11-07 18:02:16 -050026gpiodcxx = dependency('libgpiodcxx')
Andrew Jeffery2d66c242021-05-27 12:57:50 +093027
28# i2c-tools doesn't ship a pkg-config file for libi2c
Brad Bishopfeb19ef2019-11-07 18:02:16 -050029i2c = meson.get_compiler('cpp').find_library('i2c')
Andrew Jeffery2d66c242021-05-27 12:57:50 +093030
Andrew Jeffery3f2e0522021-05-27 13:26:20 +093031sdbusplus = dependency(
32 'sdbusplus',
33 fallback: [
34 'sdbusplus',
35 'sdbusplus_dep'
36 ],
37)
38
Brad Bishopfeb19ef2019-11-07 18:02:16 -050039systemd = dependency('systemd')
Andrew Jefferyfbf92542021-05-27 15:00:47 +093040systemd_system_unit_dir = systemd.get_variable(
41 pkgconfig: 'systemdsystemunitdir',
42 pkgconfig_define: ['prefix', get_option('prefix')])
Brad Bishopfeb19ef2019-11-07 18:02:16 -050043threads = dependency('threads')
44
45thresholds_a = static_library(
46 'thresholds_a',
47 'src/Thresholds.cpp',
Andrew Jeffery8ed93af2021-05-27 13:45:38 +093048 dependencies: [ sdbusplus ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -050049 implicit_include_directories: false,
50 include_directories: 'include',
51)
52
53utils_a = static_library(
54 'utils_a',
Ed Tanous6cb732a2021-02-18 15:33:51 -080055 ['src/Utils.cpp', 'src/SensorPaths.cpp'],
Andrew Jeffery8ed93af2021-05-27 13:45:38 +093056 dependencies: [ sdbusplus ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -050057 implicit_include_directories: false,
58 include_directories: 'include',
59)
60
61pwmsensor_a = static_library(
62 'pwmsensor_a',
63 'src/PwmSensor.cpp',
Andrew Jeffery8ed93af2021-05-27 13:45:38 +093064 dependencies: [ sdbusplus ],
Brad Bishopfeb19ef2019-11-07 18:02:16 -050065 implicit_include_directories: false,
66 include_directories: 'include',
67)
68
Bruce Lee1263c3d2021-06-04 15:16:33 +080069subdir('include')
Brad Bishopfeb19ef2019-11-07 18:02:16 -050070subdir('service_files')
71subdir('src')
72
73if not build_tests.disabled()
74 subdir('tests')
75endif