blob: af8cdf3ecfe2a7b3f8e2f822279c8c7d2859ea16 [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')
Manojkiran Eda22a03e32022-06-17 09:14:41 +053015
16python = import('python')
17python_bin = python.find_installation('python3', modules:['inflection', 'yaml', 'mako'])
18
19if not python_bin.found()
20 error('No valid python3 installation found')
21endif
22
23
Patrick Williams7f664252020-06-04 10:20:56 -050024root_inc = include_directories('include')
Patrick Williams98d71082020-05-15 18:55:16 -050025
26libsdbusplus_src = files(
Patrick Williams74187662022-08-26 19:28:24 -050027 'src/async/context.cpp',
Patrick Williams290fa422022-08-29 09:15:58 -050028 'src/async/match.cpp',
Patrick Williams32ffb032020-10-12 12:17:48 -050029 'src/bus.cpp',
Patrick Williamsd2b00442022-09-16 08:28:07 -050030 'src/event.cpp',
Patrick Williams74187662022-08-26 19:28:24 -050031 'src/exception.cpp',
William A. Kennington III226bc422021-05-05 17:08:36 -070032 'src/message/native_types.cpp',
Patrick Williams7f664252020-06-04 10:20:56 -050033 'src/sdbus.cpp',
Patrick Williams32ffb032020-10-12 12:17:48 -050034 'src/server/interface.cpp',
Patrick Williams7f664252020-06-04 10:20:56 -050035 'src/server/transaction.cpp',
Patrick Williams98d71082020-05-15 18:55:16 -050036)
37
William A. Kennington IIIf69a8b72020-05-28 12:59:40 -070038libsdbusplus = library(
Patrick Williams98d71082020-05-15 18:55:16 -050039 'sdbusplus',
40 libsdbusplus_src,
Patrick Williams7f664252020-06-04 10:20:56 -050041 include_directories: root_inc,
Patrick Williams98d71082020-05-15 18:55:16 -050042 dependencies: libsystemd_pkg,
43 version: meson.project_version(),
44 install: true,
45)
46
William A. Kennington III270f2422021-06-04 16:07:43 -070047boost_compile_args = [
48 '-DBOOST_ASIO_DISABLE_THREADS',
49 '-DBOOST_ALL_NO_LIB',
50 '-DBOOST_SYSTEM_NO_DEPRECATED',
51 '-DBOOST_ERROR_CODE_HEADER_ONLY',
52 '-DBOOST_COROUTINES_NO_DEPRECATION_WARNING',
53]
54
55boost_dep = declare_dependency(
56 dependencies: dependency('boost', required: false),
57 compile_args: boost_compile_args)
58
Patrick Williamsd0285b92020-06-01 09:43:47 -050059sdbusplus_dep = declare_dependency(
60 include_directories: root_inc,
61 link_with: libsdbusplus,
William A. Kennington III270f2422021-06-04 16:07:43 -070062 dependencies: [ libsystemd_pkg, boost_dep ],
Patrick Williamsd0285b92020-06-01 09:43:47 -050063)
64
Patrick Williamsad145e02020-05-19 16:45:15 -050065subdir('tools')
66
William A. Kennington III5e893b92020-06-04 02:47:29 -070067if not get_option('examples').disabled()
68 subdir('example')
69endif
70if not get_option('tests').disabled()
71 subdir('test')
72endif
Patrick Williamsad145e02020-05-19 16:45:15 -050073
Patrick Williams98d71082020-05-15 18:55:16 -050074install_subdir(
Patrick Williams7f664252020-06-04 10:20:56 -050075 'include/sdbusplus',
Patrick Williams98d71082020-05-15 18:55:16 -050076 install_dir: get_option('includedir'),
77 strip_directory: false,
Patrick Williams98d71082020-05-15 18:55:16 -050078)
79
80import('pkgconfig').generate(
Patrick Williamsfe0edaa2021-04-15 13:30:16 -050081 libsdbusplus,
Patrick Williams98d71082020-05-15 18:55:16 -050082 name: meson.project_name(),
83 version: meson.project_version(),
Patrick Williamsfa3137a2020-05-28 14:49:15 -050084 requires: libsystemd_pkg,
William A. Kennington III270f2422021-06-04 16:07:43 -070085 extra_cflags: boost_compile_args,
Patrick Williams98d71082020-05-15 18:55:16 -050086 description: 'C++ bindings for sdbus',
87)