blob: b78a71adad6bd16eab0efcc6fd91f07b725c0468 [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 Williams601d9752021-07-21 14:16:06 -05005 'warning_level=3',
Patrick Williams98d71082020-05-15 18:55:16 -05006 'werror=true',
William A. Kennington IIIf05b4ca2020-06-04 02:48:52 -07007 'tests=' + (meson.is_subproject() ? 'disabled' : 'auto'),
8 'examples=' + (meson.is_subproject() ? 'disabled' : 'auto'),
Patrick Williams98d71082020-05-15 18:55:16 -05009 ],
10 version: '1.0.0',
Patrick Williams2e988612021-04-14 14:49:25 -050011 meson_version: '>=0.57.0',
Patrick Williams98d71082020-05-15 18:55:16 -050012)
13
14libsystemd_pkg = dependency('libsystemd')
Patrick Williams7f664252020-06-04 10:20:56 -050015root_inc = include_directories('include')
Patrick Williams98d71082020-05-15 18:55:16 -050016
17libsdbusplus_src = files(
Patrick Williams7f664252020-06-04 10:20:56 -050018 'src/exception.cpp',
Patrick Williams32ffb032020-10-12 12:17:48 -050019 'src/bus.cpp',
William A. Kennington III226bc422021-05-05 17:08:36 -070020 'src/message/native_types.cpp',
Patrick Williams7f664252020-06-04 10:20:56 -050021 'src/sdbus.cpp',
Patrick Williams32ffb032020-10-12 12:17:48 -050022 'src/server/interface.cpp',
Patrick Williams7f664252020-06-04 10:20:56 -050023 'src/server/transaction.cpp',
Patrick Williams98d71082020-05-15 18:55:16 -050024)
25
William A. Kennington IIIf69a8b72020-05-28 12:59:40 -070026libsdbusplus = library(
Patrick Williams98d71082020-05-15 18:55:16 -050027 'sdbusplus',
28 libsdbusplus_src,
Patrick Williams7f664252020-06-04 10:20:56 -050029 include_directories: root_inc,
Patrick Williams98d71082020-05-15 18:55:16 -050030 dependencies: libsystemd_pkg,
31 version: meson.project_version(),
32 install: true,
33)
34
William A. Kennington III270f2422021-06-04 16:07:43 -070035boost_compile_args = [
36 '-DBOOST_ASIO_DISABLE_THREADS',
37 '-DBOOST_ALL_NO_LIB',
38 '-DBOOST_SYSTEM_NO_DEPRECATED',
39 '-DBOOST_ERROR_CODE_HEADER_ONLY',
40 '-DBOOST_COROUTINES_NO_DEPRECATION_WARNING',
41]
42
43boost_dep = declare_dependency(
44 dependencies: dependency('boost', required: false),
45 compile_args: boost_compile_args)
46
Patrick Williamsd0285b92020-06-01 09:43:47 -050047sdbusplus_dep = declare_dependency(
48 include_directories: root_inc,
49 link_with: libsdbusplus,
William A. Kennington III270f2422021-06-04 16:07:43 -070050 dependencies: [ libsystemd_pkg, boost_dep ],
Patrick Williamsd0285b92020-06-01 09:43:47 -050051)
52
Patrick Williamsad145e02020-05-19 16:45:15 -050053subdir('tools')
54
William A. Kennington III5e893b92020-06-04 02:47:29 -070055if not get_option('examples').disabled()
56 subdir('example')
57endif
58if not get_option('tests').disabled()
59 subdir('test')
60endif
Patrick Williamsad145e02020-05-19 16:45:15 -050061
Patrick Williams98d71082020-05-15 18:55:16 -050062install_subdir(
Patrick Williams7f664252020-06-04 10:20:56 -050063 'include/sdbusplus',
Patrick Williams98d71082020-05-15 18:55:16 -050064 install_dir: get_option('includedir'),
65 strip_directory: false,
Patrick Williams98d71082020-05-15 18:55:16 -050066)
67
68import('pkgconfig').generate(
Patrick Williamsfe0edaa2021-04-15 13:30:16 -050069 libsdbusplus,
Patrick Williams98d71082020-05-15 18:55:16 -050070 name: meson.project_name(),
71 version: meson.project_version(),
Patrick Williamsfa3137a2020-05-28 14:49:15 -050072 requires: libsystemd_pkg,
William A. Kennington III270f2422021-06-04 16:07:43 -070073 extra_cflags: boost_compile_args,
Patrick Williams98d71082020-05-15 18:55:16 -050074 description: 'C++ bindings for sdbus',
75)