blob: 790684ea093d7c4dd153c4aea391249f194232be [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 Williams2e988612021-04-14 14:49:25 -05004 'cpp_std=c++20',
Patrick Williams98d71082020-05-15 18:55:16 -05005 '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',
Patrick Williams2e988612021-04-14 14:49:25 -050010 meson_version: '>=0.57.0',
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',
Patrick Williams32ffb032020-10-12 12:17:48 -050018 'src/bus.cpp',
William A. Kennington III226bc422021-05-05 17:08:36 -070019 'src/message/native_types.cpp',
Patrick Williams7f664252020-06-04 10:20:56 -050020 'src/sdbus.cpp',
Patrick Williams32ffb032020-10-12 12:17:48 -050021 'src/server/interface.cpp',
Patrick Williams7f664252020-06-04 10:20:56 -050022 'src/server/transaction.cpp',
Patrick Williams98d71082020-05-15 18:55:16 -050023)
24
William A. Kennington IIIf69a8b72020-05-28 12:59:40 -070025libsdbusplus = library(
Patrick Williams98d71082020-05-15 18:55:16 -050026 'sdbusplus',
27 libsdbusplus_src,
Patrick Williams7f664252020-06-04 10:20:56 -050028 include_directories: root_inc,
Patrick Williams98d71082020-05-15 18:55:16 -050029 dependencies: libsystemd_pkg,
30 version: meson.project_version(),
31 install: true,
32)
33
Patrick Williamsd0285b92020-06-01 09:43:47 -050034sdbusplus_dep = declare_dependency(
35 include_directories: root_inc,
36 link_with: libsdbusplus,
37 dependencies: libsystemd_pkg
38)
39
Patrick Williamsad145e02020-05-19 16:45:15 -050040subdir('tools')
41
Patrick Williams3a6d5842020-06-09 14:59:58 -050042boost_dep = dependency(
43 'boost',
44 disabler: true,
45 required: false,
Patrick Williams3f90a142020-06-09 15:44:13 -050046 modules: [ 'coroutine', 'context' ],
Patrick Williams3a6d5842020-06-09 14:59:58 -050047)
Patrick Williamsad145e02020-05-19 16:45:15 -050048
William A. Kennington III5e893b92020-06-04 02:47:29 -070049if not get_option('examples').disabled()
50 subdir('example')
51endif
52if not get_option('tests').disabled()
53 subdir('test')
54endif
Patrick Williamsad145e02020-05-19 16:45:15 -050055
Patrick Williams98d71082020-05-15 18:55:16 -050056install_subdir(
Patrick Williams7f664252020-06-04 10:20:56 -050057 'include/sdbusplus',
Patrick Williams98d71082020-05-15 18:55:16 -050058 install_dir: get_option('includedir'),
59 strip_directory: false,
Patrick Williams98d71082020-05-15 18:55:16 -050060)
61
62import('pkgconfig').generate(
Patrick Williamsfe0edaa2021-04-15 13:30:16 -050063 libsdbusplus,
Patrick Williams98d71082020-05-15 18:55:16 -050064 name: meson.project_name(),
65 version: meson.project_version(),
Patrick Williamsfa3137a2020-05-28 14:49:15 -050066 requires: libsystemd_pkg,
Patrick Williams98d71082020-05-15 18:55:16 -050067 description: 'C++ bindings for sdbus',
68)