Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 1 | project('sdbusplus', 'cpp', 'c', |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 2 | default_options: [ |
Patrick Williams | feb4847 | 2020-05-19 06:23:10 -0500 | [diff] [blame] | 3 | 'buildtype=debugoptimized', |
Patrick Williams | 2e98861 | 2021-04-14 14:49:25 -0500 | [diff] [blame] | 4 | 'cpp_std=c++20', |
Patrick Williams | 601d975 | 2021-07-21 14:16:06 -0500 | [diff] [blame] | 5 | 'warning_level=3', |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 6 | 'werror=true', |
William A. Kennington III | f05b4ca | 2020-06-04 02:48:52 -0700 | [diff] [blame] | 7 | 'tests=' + (meson.is_subproject() ? 'disabled' : 'auto'), |
| 8 | 'examples=' + (meson.is_subproject() ? 'disabled' : 'auto'), |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 9 | ], |
| 10 | version: '1.0.0', |
Patrick Williams | 2e98861 | 2021-04-14 14:49:25 -0500 | [diff] [blame] | 11 | meson_version: '>=0.57.0', |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 12 | ) |
| 13 | |
| 14 | libsystemd_pkg = dependency('libsystemd') |
Manojkiran Eda | 22a03e3 | 2022-06-17 09:14:41 +0530 | [diff] [blame] | 15 | |
| 16 | python = import('python') |
| 17 | python_bin = python.find_installation('python3', modules:['inflection', 'yaml', 'mako']) |
| 18 | |
| 19 | if not python_bin.found() |
| 20 | error('No valid python3 installation found') |
| 21 | endif |
| 22 | |
| 23 | |
Patrick Williams | 7f66425 | 2020-06-04 10:20:56 -0500 | [diff] [blame] | 24 | root_inc = include_directories('include') |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 25 | |
| 26 | libsdbusplus_src = files( |
Patrick Williams | 7418766 | 2022-08-26 19:28:24 -0500 | [diff] [blame] | 27 | 'src/async/context.cpp', |
Patrick Williams | 290fa42 | 2022-08-29 09:15:58 -0500 | [diff] [blame] | 28 | 'src/async/match.cpp', |
Patrick Williams | 0139cac | 2022-09-20 17:04:17 -0500 | [diff] [blame] | 29 | 'src/async/scope.cpp', |
Patrick Williams | 32ffb03 | 2020-10-12 12:17:48 -0500 | [diff] [blame] | 30 | 'src/bus.cpp', |
Patrick Williams | d2b0044 | 2022-09-16 08:28:07 -0500 | [diff] [blame] | 31 | 'src/event.cpp', |
Patrick Williams | 7418766 | 2022-08-26 19:28:24 -0500 | [diff] [blame] | 32 | 'src/exception.cpp', |
William A. Kennington III | 226bc42 | 2021-05-05 17:08:36 -0700 | [diff] [blame] | 33 | 'src/message/native_types.cpp', |
Patrick Williams | 7f66425 | 2020-06-04 10:20:56 -0500 | [diff] [blame] | 34 | 'src/sdbus.cpp', |
Patrick Williams | 32ffb03 | 2020-10-12 12:17:48 -0500 | [diff] [blame] | 35 | 'src/server/interface.cpp', |
Patrick Williams | 7f66425 | 2020-06-04 10:20:56 -0500 | [diff] [blame] | 36 | 'src/server/transaction.cpp', |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 37 | ) |
| 38 | |
William A. Kennington III | f69a8b7 | 2020-05-28 12:59:40 -0700 | [diff] [blame] | 39 | libsdbusplus = library( |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 40 | 'sdbusplus', |
| 41 | libsdbusplus_src, |
Patrick Williams | 7f66425 | 2020-06-04 10:20:56 -0500 | [diff] [blame] | 42 | include_directories: root_inc, |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 43 | dependencies: libsystemd_pkg, |
| 44 | version: meson.project_version(), |
| 45 | install: true, |
| 46 | ) |
| 47 | |
William A. Kennington III | 270f242 | 2021-06-04 16:07:43 -0700 | [diff] [blame] | 48 | boost_compile_args = [ |
| 49 | '-DBOOST_ASIO_DISABLE_THREADS', |
| 50 | '-DBOOST_ALL_NO_LIB', |
| 51 | '-DBOOST_SYSTEM_NO_DEPRECATED', |
| 52 | '-DBOOST_ERROR_CODE_HEADER_ONLY', |
| 53 | '-DBOOST_COROUTINES_NO_DEPRECATION_WARNING', |
| 54 | ] |
| 55 | |
| 56 | boost_dep = declare_dependency( |
| 57 | dependencies: dependency('boost', required: false), |
| 58 | compile_args: boost_compile_args) |
| 59 | |
Patrick Williams | d0285b9 | 2020-06-01 09:43:47 -0500 | [diff] [blame] | 60 | sdbusplus_dep = declare_dependency( |
| 61 | include_directories: root_inc, |
| 62 | link_with: libsdbusplus, |
William A. Kennington III | 270f242 | 2021-06-04 16:07:43 -0700 | [diff] [blame] | 63 | dependencies: [ libsystemd_pkg, boost_dep ], |
Patrick Williams | d0285b9 | 2020-06-01 09:43:47 -0500 | [diff] [blame] | 64 | ) |
| 65 | |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 66 | subdir('tools') |
| 67 | |
William A. Kennington III | 5e893b9 | 2020-06-04 02:47:29 -0700 | [diff] [blame] | 68 | if not get_option('examples').disabled() |
| 69 | subdir('example') |
| 70 | endif |
| 71 | if not get_option('tests').disabled() |
| 72 | subdir('test') |
| 73 | endif |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 74 | |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 75 | install_subdir( |
Patrick Williams | 7f66425 | 2020-06-04 10:20:56 -0500 | [diff] [blame] | 76 | 'include/sdbusplus', |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 77 | install_dir: get_option('includedir'), |
| 78 | strip_directory: false, |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 79 | ) |
| 80 | |
| 81 | import('pkgconfig').generate( |
Patrick Williams | fe0edaa | 2021-04-15 13:30:16 -0500 | [diff] [blame] | 82 | libsdbusplus, |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 83 | name: meson.project_name(), |
| 84 | version: meson.project_version(), |
Patrick Williams | fa3137a | 2020-05-28 14:49:15 -0500 | [diff] [blame] | 85 | requires: libsystemd_pkg, |
William A. Kennington III | 270f242 | 2021-06-04 16:07:43 -0700 | [diff] [blame] | 86 | extra_cflags: boost_compile_args, |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 87 | description: 'C++ bindings for sdbus', |
| 88 | ) |