blob: 0ebde387b6ba541b1f22075065dd56f436fad66d [file] [log] [blame]
Brad Bishop0aa15902019-05-08 21:30:01 -04001project(
2 'phosphor-objmgr',
3 'c', 'cpp',
4 default_options: [
Brad Bishop370daaa2021-08-02 23:30:49 -04005 'cpp_std=c++20',
Brad Bishop0aa15902019-05-08 21:30:01 -04006 'warning_level=3',
7 'werror=true',
8 ],
9 license: 'Apache-2.0',
Brad Bishop370daaa2021-08-02 23:30:49 -040010 meson_version: '>=0.57.0',
Brad Bishop0aa15902019-05-08 21:30:01 -040011 version: '1.0',
12)
13
Patrick Williamsf814e5b2022-03-21 11:14:17 -050014phosphor_logging = dependency('phosphor-logging')
Brad Bishop5962db52022-05-16 21:04:05 -040015phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
Patrick Williamsf814e5b2022-03-21 11:14:17 -050016sdbusplus = dependency('sdbusplus')
Brad Bishop0aa15902019-05-08 21:30:01 -040017
18if get_option('tests').enabled()
19 gtest = dependency('gtest', main: true, disabler: true, required: false)
20 gmock = dependency('gmock', disabler: true, required: false)
21 if not gtest.found() or not gmock.found()
22 gtest_proj = import('cmake').subproject('googletest', required: false)
23 if gtest_proj.found()
24 gtest = declare_dependency(
25 dependencies: [
26 dependency('threads'),
27 gtest_proj.dependency('gtest'),
28 gtest_proj.dependency('gtest_main'),
29 ]
30 )
31 gmock = gtest_proj.dependency('gmock')
32 else
33 assert(
34 not get_option('tests').enabled(),
35 'Googletest is required if tests are enabled'
36 )
37 endif
38 endif
39 subdir('src/test')
40 subdir('libmapper/test')
41endif
42
Brad Bishop0aa15902019-05-08 21:30:01 -040043install_headers('libmapper/mapper.h')
44
45libmapper = library(
46 'mapper',
47 'libmapper/mapper.c',
48 dependencies: [ dependency('libsystemd') ],
49 gnu_symbol_visibility: 'hidden',
50 version: meson.project_version(),
51 install: true)
52
53import('pkgconfig').generate(
54 name: 'libmapper',
55 description: 'OpenBMC service discovery utility library',
56 version: meson.project_version(),
57 libraries: libmapper)
58
59executable(
60 'mapper',
61 'libmapper/app.c',
62 link_with: libmapper,
63 dependencies: [ dependency('libsystemd') ],
64 install: true)
65
66executable(
67 'mapperx',
68 [
69 'src/main.cpp',
70 'src/argument.cpp',
71 'src/processing.cpp',
72 'src/associations.cpp',
73 ],
74 dependencies: [
75 dependency('boost'),
76 dependency('libsystemd'),
Brad Bishop5962db52022-05-16 21:04:05 -040077 phosphor_dbus_interfaces,
Brad Bishop0aa15902019-05-08 21:30:01 -040078 phosphor_logging,
79 sdbusplus,
80 dependency('systemd'),
81 dependency('threads'),
82 dependency('tinyxml2'),
83 ],
84 install: true
85)
86
87executable(
88 'phosphor-unit-failure-monitor',
89 [
90 'fail-monitor/argument.cpp',
91 'fail-monitor/main.cpp',
92 'fail-monitor/monitor.cpp',
93 ],
94 dependencies: [
95 phosphor_logging,
96 ],
97 install: true
98)