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 | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 4 | 'cpp_std=c++17', |
| 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', |
William A. Kennington III | adf0354 | 2020-06-04 03:01:11 -0700 | [diff] [blame] | 10 | meson_version: '>=0.53.2', |
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', |
Patrick Williams | 7f66425 | 2020-06-04 10:20:56 -0500 | [diff] [blame] | 19 | 'src/sdbus.cpp', |
Patrick Williams | 32ffb03 | 2020-10-12 12:17:48 -0500 | [diff] [blame] | 20 | 'src/server/interface.cpp', |
Patrick Williams | 7f66425 | 2020-06-04 10:20:56 -0500 | [diff] [blame] | 21 | 'src/server/transaction.cpp', |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 22 | ) |
| 23 | |
William A. Kennington III | f69a8b7 | 2020-05-28 12:59:40 -0700 | [diff] [blame] | 24 | libsdbusplus = library( |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 25 | 'sdbusplus', |
| 26 | libsdbusplus_src, |
Patrick Williams | 7f66425 | 2020-06-04 10:20:56 -0500 | [diff] [blame] | 27 | include_directories: root_inc, |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 28 | dependencies: libsystemd_pkg, |
| 29 | version: meson.project_version(), |
| 30 | install: true, |
| 31 | ) |
| 32 | |
Patrick Williams | d0285b9 | 2020-06-01 09:43:47 -0500 | [diff] [blame] | 33 | sdbusplus_dep = declare_dependency( |
| 34 | include_directories: root_inc, |
| 35 | link_with: libsdbusplus, |
| 36 | dependencies: libsystemd_pkg |
| 37 | ) |
| 38 | |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 39 | subdir('tools') |
| 40 | |
Patrick Williams | 3a6d584 | 2020-06-09 14:59:58 -0500 | [diff] [blame] | 41 | boost_dep = dependency( |
| 42 | 'boost', |
| 43 | disabler: true, |
| 44 | required: false, |
Patrick Williams | 3f90a14 | 2020-06-09 15:44:13 -0500 | [diff] [blame] | 45 | modules: [ 'coroutine', 'context' ], |
Patrick Williams | 3a6d584 | 2020-06-09 14:59:58 -0500 | [diff] [blame] | 46 | ) |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 47 | |
William A. Kennington III | 5e893b9 | 2020-06-04 02:47:29 -0700 | [diff] [blame] | 48 | if not get_option('examples').disabled() |
| 49 | subdir('example') |
| 50 | endif |
| 51 | if not get_option('tests').disabled() |
| 52 | subdir('test') |
| 53 | endif |
Patrick Williams | ad145e0 | 2020-05-19 16:45:15 -0500 | [diff] [blame] | 54 | |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 55 | install_subdir( |
Patrick Williams | 7f66425 | 2020-06-04 10:20:56 -0500 | [diff] [blame] | 56 | 'include/sdbusplus', |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 57 | install_dir: get_option('includedir'), |
| 58 | strip_directory: false, |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 59 | ) |
| 60 | |
| 61 | import('pkgconfig').generate( |
| 62 | libraries: libsdbusplus, |
| 63 | name: meson.project_name(), |
| 64 | version: meson.project_version(), |
Patrick Williams | fa3137a | 2020-05-28 14:49:15 -0500 | [diff] [blame] | 65 | requires: libsystemd_pkg, |
Patrick Williams | 98d7108 | 2020-05-15 18:55:16 -0500 | [diff] [blame] | 66 | description: 'C++ bindings for sdbus', |
| 67 | ) |