blob: e089391e5f5aac16eabc18d3d8e0de91b1716b5d [file] [log] [blame]
Patrick Williamsad145e02020-05-19 16:45:15 -05001project('sdbusplus', 'cpp', 'c',
Patrick Williams98d71082020-05-15 18:55:16 -05002 default_options: [
Patrick Williamsfeb48472020-05-19 06:23:10 -05003 'buildtype=debugoptimized',
Patrick Williams98d71082020-05-15 18:55:16 -05004 'cpp_std=c++17',
5 'werror=true',
William A. Kennington IIIf05b4ca2020-06-04 02:48:52 -07006 'tests=' + (meson.is_subproject() ? 'disabled' : 'auto'),
7 'examples=' + (meson.is_subproject() ? 'disabled' : 'auto'),
Patrick Williams98d71082020-05-15 18:55:16 -05008 ],
9 version: '1.0.0',
William A. Kennington IIIadf03542020-06-04 03:01:11 -070010 meson_version: '>=0.53.2',
Patrick Williams98d71082020-05-15 18:55:16 -050011)
12
13libsystemd_pkg = dependency('libsystemd')
Patrick Williams7f664252020-06-04 10:20:56 -050014root_inc = include_directories('include')
Patrick Williams98d71082020-05-15 18:55:16 -050015
16libsdbusplus_src = files(
Patrick Williams7f664252020-06-04 10:20:56 -050017 'src/exception.cpp',
18 'src/sdbus.cpp',
19 'src/server/transaction.cpp',
Patrick Williams98d71082020-05-15 18:55:16 -050020)
21
William A. Kennington IIIf69a8b72020-05-28 12:59:40 -070022libsdbusplus = library(
Patrick Williams98d71082020-05-15 18:55:16 -050023 'sdbusplus',
24 libsdbusplus_src,
Patrick Williams7f664252020-06-04 10:20:56 -050025 include_directories: root_inc,
Patrick Williams98d71082020-05-15 18:55:16 -050026 dependencies: libsystemd_pkg,
27 version: meson.project_version(),
28 install: true,
29)
30
Patrick Williamsd0285b92020-06-01 09:43:47 -050031sdbusplus_dep = declare_dependency(
32 include_directories: root_inc,
33 link_with: libsdbusplus,
34 dependencies: libsystemd_pkg
35)
36
Patrick Williamsad145e02020-05-19 16:45:15 -050037subdir('tools')
38
Patrick Williams3a6d5842020-06-09 14:59:58 -050039boost_dep = dependency(
40 'boost',
41 disabler: true,
42 required: false,
Patrick Williams3f90a142020-06-09 15:44:13 -050043 modules: [ 'coroutine', 'context' ],
Patrick Williams3a6d5842020-06-09 14:59:58 -050044)
Patrick Williamsad145e02020-05-19 16:45:15 -050045
William A. Kennington III5e893b92020-06-04 02:47:29 -070046if not get_option('examples').disabled()
47 subdir('example')
48endif
49if not get_option('tests').disabled()
50 subdir('test')
51endif
Patrick Williamsad145e02020-05-19 16:45:15 -050052
Patrick Williams98d71082020-05-15 18:55:16 -050053install_subdir(
Patrick Williams7f664252020-06-04 10:20:56 -050054 'include/sdbusplus',
Patrick Williams98d71082020-05-15 18:55:16 -050055 install_dir: get_option('includedir'),
56 strip_directory: false,
Patrick Williams98d71082020-05-15 18:55:16 -050057)
58
59import('pkgconfig').generate(
60 libraries: libsdbusplus,
61 name: meson.project_name(),
62 version: meson.project_version(),
Patrick Williamsfa3137a2020-05-28 14:49:15 -050063 requires: libsystemd_pkg,
Patrick Williams98d71082020-05-15 18:55:16 -050064 description: 'C++ bindings for sdbus',
65)