Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 1 | project( |
| 2 | 'dbus-sensors', |
| 3 | 'cpp', |
| 4 | default_options: [ |
| 5 | 'warning_level=3', |
| 6 | 'werror=true', |
Andrew Jeffery | fbf9254 | 2021-05-27 15:00:47 +0930 | [diff] [blame] | 7 | 'cpp_std=c++20' |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 8 | ], |
| 9 | license: 'Apache-2.0', |
| 10 | version: '0.1', |
Andrew Jeffery | fbf9254 | 2021-05-27 15:00:47 +0930 | [diff] [blame] | 11 | meson_version: '>=0.57.0', |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 12 | ) |
| 13 | |
| 14 | add_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 | |
| 25 | build_tests = get_option('tests') |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 26 | gpiodcxx = dependency('libgpiodcxx') |
Andrew Jeffery | 2d66c24 | 2021-05-27 12:57:50 +0930 | [diff] [blame] | 27 | |
| 28 | # i2c-tools doesn't ship a pkg-config file for libi2c |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 29 | i2c = meson.get_compiler('cpp').find_library('i2c') |
Andrew Jeffery | 2d66c24 | 2021-05-27 12:57:50 +0930 | [diff] [blame] | 30 | |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 31 | sdbusplus = dependency('sdbusplus') |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 32 | systemd = dependency('systemd') |
Andrew Jeffery | fbf9254 | 2021-05-27 15:00:47 +0930 | [diff] [blame] | 33 | systemd_system_unit_dir = systemd.get_variable( |
| 34 | pkgconfig: 'systemdsystemunitdir', |
| 35 | pkgconfig_define: ['prefix', get_option('prefix')]) |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 36 | threads = dependency('threads') |
| 37 | |
| 38 | thresholds_a = static_library( |
| 39 | 'thresholds_a', |
| 40 | 'src/Thresholds.cpp', |
Andrew Jeffery | 8ed93af | 2021-05-27 13:45:38 +0930 | [diff] [blame^] | 41 | dependencies: [ sdbusplus ], |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 42 | implicit_include_directories: false, |
| 43 | include_directories: 'include', |
| 44 | ) |
| 45 | |
| 46 | utils_a = static_library( |
| 47 | 'utils_a', |
Ed Tanous | 6cb732a | 2021-02-18 15:33:51 -0800 | [diff] [blame] | 48 | ['src/Utils.cpp', 'src/SensorPaths.cpp'], |
Andrew Jeffery | 8ed93af | 2021-05-27 13:45:38 +0930 | [diff] [blame^] | 49 | dependencies: [ sdbusplus ], |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 50 | implicit_include_directories: false, |
| 51 | include_directories: 'include', |
| 52 | ) |
| 53 | |
| 54 | pwmsensor_a = static_library( |
| 55 | 'pwmsensor_a', |
| 56 | 'src/PwmSensor.cpp', |
Andrew Jeffery | 8ed93af | 2021-05-27 13:45:38 +0930 | [diff] [blame^] | 57 | dependencies: [ sdbusplus ], |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 58 | implicit_include_directories: false, |
| 59 | include_directories: 'include', |
| 60 | ) |
| 61 | |
| 62 | |
| 63 | subdir('service_files') |
| 64 | subdir('src') |
| 65 | |
| 66 | if not build_tests.disabled() |
| 67 | subdir('tests') |
| 68 | endif |