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