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 | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 5 | 'werror=true', |
William A. Kennington III | f05b4ca | 2020-06-04 02:48:52 -0700 | [diff] [blame] | 6 | 'tests=' + (meson.is_subproject() ? 'disabled' : 'auto'), |
| 7 | 'examples=' + (meson.is_subproject() ? 'disabled' : 'auto'), |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 8 | ], |
| 9 | version: '1.0.0', |
Patrick Williams | 2e98861 | 2021-04-14 14:49:25 -0500 | [diff] [blame] | 10 | meson_version: '>=0.57.0', |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 11 | ) |
| 12 | |
| 13 | libsystemd_pkg = dependency('libsystemd') |
Patrick Williams | 7f66425 | 2020-06-04 10:20:56 -0500 | [diff] [blame] | 14 | root_inc = include_directories('include') |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 15 | |
| 16 | libsdbusplus_src = files( |
Patrick Williams | 7f66425 | 2020-06-04 10:20:56 -0500 | [diff] [blame] | 17 | 'src/exception.cpp', |
Patrick Williams | 32ffb03 | 2020-10-12 12:17:48 -0500 | [diff] [blame] | 18 | 'src/bus.cpp', |
William A. Kennington III | 226bc42 | 2021-05-05 17:08:36 -0700 | [diff] [blame] | 19 | 'src/message/native_types.cpp', |
Patrick Williams | 7f66425 | 2020-06-04 10:20:56 -0500 | [diff] [blame] | 20 | 'src/sdbus.cpp', |
Patrick Williams | 32ffb03 | 2020-10-12 12:17:48 -0500 | [diff] [blame] | 21 | 'src/server/interface.cpp', |
Patrick Williams | 7f66425 | 2020-06-04 10:20:56 -0500 | [diff] [blame] | 22 | 'src/server/transaction.cpp', |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 23 | ) |
| 24 | |
William A. Kennington III | f69a8b7 | 2020-05-28 12:59:40 -0700 | [diff] [blame] | 25 | libsdbusplus = library( |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 26 | 'sdbusplus', |
| 27 | libsdbusplus_src, |
Patrick Williams | 7f66425 | 2020-06-04 10:20:56 -0500 | [diff] [blame] | 28 | include_directories: root_inc, |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 29 | dependencies: libsystemd_pkg, |
| 30 | version: meson.project_version(), |
| 31 | install: true, |
| 32 | ) |
| 33 | |
William A. Kennington III | 270f242 | 2021-06-04 16:07:43 -0700 | [diff] [blame] | 34 | boost_compile_args = [ |
| 35 | '-DBOOST_ASIO_DISABLE_THREADS', |
| 36 | '-DBOOST_ALL_NO_LIB', |
| 37 | '-DBOOST_SYSTEM_NO_DEPRECATED', |
| 38 | '-DBOOST_ERROR_CODE_HEADER_ONLY', |
| 39 | '-DBOOST_COROUTINES_NO_DEPRECATION_WARNING', |
| 40 | ] |
| 41 | |
| 42 | boost_dep = declare_dependency( |
| 43 | dependencies: dependency('boost', required: false), |
| 44 | compile_args: boost_compile_args) |
| 45 | |
Patrick Williams | d0285b9 | 2020-06-01 09:43:47 -0500 | [diff] [blame] | 46 | sdbusplus_dep = declare_dependency( |
| 47 | include_directories: root_inc, |
| 48 | link_with: libsdbusplus, |
William A. Kennington III | 270f242 | 2021-06-04 16:07:43 -0700 | [diff] [blame] | 49 | dependencies: [ libsystemd_pkg, boost_dep ], |
Patrick Williams | d0285b9 | 2020-06-01 09:43:47 -0500 | [diff] [blame] | 50 | ) |
| 51 | |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 52 | subdir('tools') |
| 53 | |
William A. Kennington III | 5e893b9 | 2020-06-04 02:47:29 -0700 | [diff] [blame] | 54 | if not get_option('examples').disabled() |
| 55 | subdir('example') |
| 56 | endif |
| 57 | if not get_option('tests').disabled() |
| 58 | subdir('test') |
| 59 | endif |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 60 | |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 61 | install_subdir( |
Patrick Williams | 7f66425 | 2020-06-04 10:20:56 -0500 | [diff] [blame] | 62 | 'include/sdbusplus', |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 63 | install_dir: get_option('includedir'), |
| 64 | strip_directory: false, |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 65 | ) |
| 66 | |
| 67 | import('pkgconfig').generate( |
Patrick Williams | fe0edaa | 2021-04-15 13:30:16 -0500 | [diff] [blame] | 68 | libsdbusplus, |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 69 | name: meson.project_name(), |
| 70 | version: meson.project_version(), |
Patrick Williams | fa3137a | 2020-05-28 14:49:15 -0500 | [diff] [blame] | 71 | requires: libsystemd_pkg, |
William A. Kennington III | 270f242 | 2021-06-04 16:07:43 -0700 | [diff] [blame] | 72 | extra_cflags: boost_compile_args, |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 73 | description: 'C++ bindings for sdbus', |
| 74 | ) |