blob: 3a8a5cf437434212955849484ea27ec6796c1bde [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
William A. Kennington III270f2422021-06-04 16:07:43 -070034boost_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
42boost_dep = declare_dependency(
43 dependencies: dependency('boost', required: false),
44 compile_args: boost_compile_args)
45
Patrick Williamsd0285b92020-06-01 09:43:47 -050046sdbusplus_dep = declare_dependency(
47 include_directories: root_inc,
48 link_with: libsdbusplus,
William A. Kennington III270f2422021-06-04 16:07:43 -070049 dependencies: [ libsystemd_pkg, boost_dep ],
Patrick Williamsd0285b92020-06-01 09:43:47 -050050)
51
Patrick Williamsad145e02020-05-19 16:45:15 -050052subdir('tools')
53
William A. Kennington III5e893b92020-06-04 02:47:29 -070054if not get_option('examples').disabled()
55 subdir('example')
56endif
57if not get_option('tests').disabled()
58 subdir('test')
59endif
Patrick Williamsad145e02020-05-19 16:45:15 -050060
Patrick Williams98d71082020-05-15 18:55:16 -050061install_subdir(
Patrick Williams7f664252020-06-04 10:20:56 -050062 'include/sdbusplus',
Patrick Williams98d71082020-05-15 18:55:16 -050063 install_dir: get_option('includedir'),
64 strip_directory: false,
Patrick Williams98d71082020-05-15 18:55:16 -050065)
66
67import('pkgconfig').generate(
Patrick Williamsfe0edaa2021-04-15 13:30:16 -050068 libsdbusplus,
Patrick Williams98d71082020-05-15 18:55:16 -050069 name: meson.project_name(),
70 version: meson.project_version(),
Patrick Williamsfa3137a2020-05-28 14:49:15 -050071 requires: libsystemd_pkg,
William A. Kennington III270f2422021-06-04 16:07:43 -070072 extra_cflags: boost_compile_args,
Patrick Williams98d71082020-05-15 18:55:16 -050073 description: 'C++ bindings for sdbus',
74)