| 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 |  | 
| Andrew Jeffery | 3f2e052 | 2021-05-27 13:26:20 +0930 | [diff] [blame] | 31 | sdbusplus = dependency( | 
|  | 32 | 'sdbusplus', | 
|  | 33 | fallback: [ | 
|  | 34 | 'sdbusplus', | 
|  | 35 | 'sdbusplus_dep' | 
|  | 36 | ], | 
|  | 37 | ) | 
|  | 38 |  | 
| Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 39 | systemd = dependency('systemd') | 
| Andrew Jeffery | fbf9254 | 2021-05-27 15:00:47 +0930 | [diff] [blame] | 40 | systemd_system_unit_dir = systemd.get_variable( | 
|  | 41 | pkgconfig: 'systemdsystemunitdir', | 
|  | 42 | pkgconfig_define: ['prefix', get_option('prefix')]) | 
| Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 43 | threads = dependency('threads') | 
|  | 44 |  | 
|  | 45 | thresholds_a = static_library( | 
|  | 46 | 'thresholds_a', | 
|  | 47 | 'src/Thresholds.cpp', | 
| Andrew Jeffery | 8ed93af | 2021-05-27 13:45:38 +0930 | [diff] [blame] | 48 | dependencies: [ sdbusplus ], | 
| Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 49 | implicit_include_directories: false, | 
|  | 50 | include_directories: 'include', | 
|  | 51 | ) | 
|  | 52 |  | 
|  | 53 | utils_a = static_library( | 
|  | 54 | 'utils_a', | 
| Ed Tanous | 6cb732a | 2021-02-18 15:33:51 -0800 | [diff] [blame] | 55 | ['src/Utils.cpp', 'src/SensorPaths.cpp'], | 
| Andrew Jeffery | 8ed93af | 2021-05-27 13:45:38 +0930 | [diff] [blame] | 56 | dependencies: [ sdbusplus ], | 
| Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 57 | implicit_include_directories: false, | 
|  | 58 | include_directories: 'include', | 
|  | 59 | ) | 
|  | 60 |  | 
|  | 61 | pwmsensor_a = static_library( | 
|  | 62 | 'pwmsensor_a', | 
|  | 63 | 'src/PwmSensor.cpp', | 
| Andrew Jeffery | 8ed93af | 2021-05-27 13:45:38 +0930 | [diff] [blame] | 64 | dependencies: [ sdbusplus ], | 
| Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 65 | implicit_include_directories: false, | 
|  | 66 | include_directories: 'include', | 
|  | 67 | ) | 
|  | 68 |  | 
| Bruce Lee | 1263c3d | 2021-06-04 15:16:33 +0800 | [diff] [blame^] | 69 | subdir('include') | 
| Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 70 | subdir('service_files') | 
|  | 71 | subdir('src') | 
|  | 72 |  | 
|  | 73 | if not build_tests.disabled() | 
|  | 74 | subdir('tests') | 
|  | 75 | endif |