Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 1 | project( |
| 2 | 'dbus-sensors', |
| 3 | 'cpp', |
Andrew Jeffery | ab8b045 | 2024-01-11 09:55:51 +1030 | [diff] [blame] | 4 | default_options: ['warning_level=3', 'werror=true', 'cpp_std=c++20'], |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 5 | license: 'Apache-2.0', |
| 6 | version: '0.1', |
Andrew Jeffery | 8eb514a | 2024-01-04 10:30:10 +1030 | [diff] [blame] | 7 | meson_version: '>=1.1', |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 8 | ) |
| 9 | |
Patrick Williams | ab570a6 | 2023-12-07 14:49:43 -0600 | [diff] [blame] | 10 | # Enable io_uring for all daemons with below flags. |
Zhikui Ren | a0c6b5b | 2023-06-06 12:14:19 -0700 | [diff] [blame] | 11 | # '-DBOOST_ASIO_HAS_IO_URING', |
| 12 | # '-DBOOST_ASIO_DISABLE_EPOLL', |
| 13 | # '-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT', |
| 14 | # Note, there is currently an issue with CPUSensor when used in |
| 15 | # conjunction with io_uring. So it has not been changed to use |
| 16 | # random file access. But we'd like to enable it for all daemons. |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 17 | # https://github.com/openbmc/dbus-sensors/issues/19 |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 18 | |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 19 | add_project_arguments( |
Andrew Jeffery | e3b23c0 | 2021-09-23 11:29:49 +0930 | [diff] [blame] | 20 | '-Wno-psabi', |
Ed Tanous | a771f6a | 2022-01-14 09:36:51 -0800 | [diff] [blame] | 21 | '-Wuninitialized', |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 22 | '-DBOOST_SYSTEM_NO_DEPRECATED', |
Ed Tanous | 83db50c | 2023-03-01 10:20:24 -0800 | [diff] [blame] | 23 | '-DBOOST_ASIO_NO_DEPRECATED', |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 24 | '-DBOOST_ERROR_CODE_HEADER_ONLY', |
| 25 | '-DBOOST_NO_RTTI', |
| 26 | '-DBOOST_NO_TYPEID', |
| 27 | '-DBOOST_ALL_NO_LIB', |
| 28 | '-DBOOST_ASIO_DISABLE_THREADS', |
| 29 | '-DBOOST_ALLOW_DEPRECATED_HEADERS', |
Zhikui Ren | a0c6b5b | 2023-06-06 12:14:19 -0700 | [diff] [blame] | 30 | '-DBOOST_ASIO_HAS_IO_URING', |
| 31 | '-DBOOST_ASIO_DISABLE_EPOLL', |
| 32 | '-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT', |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 33 | language: 'cpp', |
| 34 | ) |
| 35 | |
Andrew Jeffery | ab8b045 | 2024-01-11 09:55:51 +1030 | [diff] [blame] | 36 | gpiodcxx = dependency( |
| 37 | 'libgpiodcxx', |
Patrick Williams | 3911b82 | 2021-08-27 14:31:50 -0500 | [diff] [blame] | 38 | default_options: ['bindings=cxx'], |
| 39 | ) |
Andrew Jeffery | 2d66c24 | 2021-05-27 12:57:50 +0930 | [diff] [blame] | 40 | |
| 41 | # i2c-tools doesn't ship a pkg-config file for libi2c |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 42 | i2c = meson.get_compiler('cpp').find_library('i2c') |
Andrew Jeffery | 2d66c24 | 2021-05-27 12:57:50 +0930 | [diff] [blame] | 43 | |
Andrew Jeffery | ab8b045 | 2024-01-11 09:55:51 +1030 | [diff] [blame] | 44 | sdbusplus = dependency('sdbusplus', required: false, include_type: 'system') |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 45 | if not sdbusplus.found() |
Andrew Jeffery | ab8b045 | 2024-01-11 09:55:51 +1030 | [diff] [blame] | 46 | sdbusplus_proj = subproject('sdbusplus', required: true) |
| 47 | sdbusplus = sdbusplus_proj.get_variable('sdbusplus_dep') |
| 48 | sdbusplus = sdbusplus.as_system('system') |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 49 | endif |
| 50 | |
Patrick Williams | 3f556a8 | 2022-03-21 11:25:15 -0500 | [diff] [blame] | 51 | phosphor_logging_dep = dependency('phosphor-logging') |
Patrick Williams | ab570a6 | 2023-12-07 14:49:43 -0600 | [diff] [blame] | 52 | nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system') |
Patrick Williams | 1889ebf | 2021-08-27 14:38:52 -0500 | [diff] [blame] | 53 | |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 54 | threads = dependency('threads') |
| 55 | |
Andrew Jeffery | ab8b045 | 2024-01-11 09:55:51 +1030 | [diff] [blame] | 56 | boost = dependency( |
| 57 | 'boost', |
| 58 | version: '>=1.79.0', |
| 59 | required: false, |
| 60 | include_type: 'system', |
| 61 | ) |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 62 | if not boost.found() |
Andrew Jeffery | ab8b045 | 2024-01-11 09:55:51 +1030 | [diff] [blame] | 63 | subproject('boost', required: false) |
| 64 | boost_inc = include_directories( |
| 65 | 'subprojects/boost_1_79_0/', |
| 66 | is_system: true, |
| 67 | ) |
| 68 | boost = declare_dependency(include_directories: boost_inc) |
| 69 | boost = boost.as_system('system') |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 70 | endif |
| 71 | |
Andrew Jeffery | 2673b9a | 2024-01-04 10:31:50 +1030 | [diff] [blame] | 72 | uring = dependency('liburing', include_type: 'system') |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 73 | |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 74 | default_deps = [ |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 75 | boost, |
Patrick Williams | ab570a6 | 2023-12-07 14:49:43 -0600 | [diff] [blame] | 76 | nlohmann_json_dep, |
Patrick Williams | 0c42f40 | 2021-08-27 16:05:45 -0500 | [diff] [blame] | 77 | phosphor_logging_dep, |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 78 | sdbusplus, |
Ed Tanous | 16966b5 | 2021-09-15 15:06:59 -0700 | [diff] [blame] | 79 | uring, |
Patrick Williams | 302a61a | 2021-08-27 15:40:08 -0500 | [diff] [blame] | 80 | ] |
| 81 | |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 82 | subdir('service_files') |
| 83 | subdir('src') |
| 84 | |
Andrew Jeffery | 771e529 | 2024-01-04 11:22:57 +1030 | [diff] [blame] | 85 | if not get_option('tests').disabled() |
Brad Bishop | feb19ef | 2019-11-07 18:02:16 -0500 | [diff] [blame] | 86 | subdir('tests') |
| 87 | endif |