blob: fe6e095f8bd9564e330f55d231ac96d61cc89130 [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')
15sdbusplus = dependency('sdbusplus')
Brad Bishop0aa15902019-05-08 21:30:01 -040016
17if get_option('tests').enabled()
18 gtest = dependency('gtest', main: true, disabler: true, required: false)
19 gmock = dependency('gmock', disabler: true, required: false)
20 if not gtest.found() or not gmock.found()
21 gtest_proj = import('cmake').subproject('googletest', required: false)
22 if gtest_proj.found()
23 gtest = declare_dependency(
24 dependencies: [
25 dependency('threads'),
26 gtest_proj.dependency('gtest'),
27 gtest_proj.dependency('gtest_main'),
28 ]
29 )
30 gmock = gtest_proj.dependency('gmock')
31 else
32 assert(
33 not get_option('tests').enabled(),
34 'Googletest is required if tests are enabled'
35 )
36 endif
37 endif
38 subdir('src/test')
39 subdir('libmapper/test')
40endif
41
Brad Bishop0aa15902019-05-08 21:30:01 -040042install_headers('libmapper/mapper.h')
43
44libmapper = library(
45 'mapper',
46 'libmapper/mapper.c',
47 dependencies: [ dependency('libsystemd') ],
48 gnu_symbol_visibility: 'hidden',
49 version: meson.project_version(),
50 install: true)
51
52import('pkgconfig').generate(
53 name: 'libmapper',
54 description: 'OpenBMC service discovery utility library',
55 version: meson.project_version(),
56 libraries: libmapper)
57
58executable(
59 'mapper',
60 'libmapper/app.c',
61 link_with: libmapper,
62 dependencies: [ dependency('libsystemd') ],
63 install: true)
64
65executable(
66 'mapperx',
67 [
68 'src/main.cpp',
69 'src/argument.cpp',
70 'src/processing.cpp',
71 'src/associations.cpp',
72 ],
73 dependencies: [
74 dependency('boost'),
75 dependency('libsystemd'),
76 phosphor_logging,
77 sdbusplus,
78 dependency('systemd'),
79 dependency('threads'),
80 dependency('tinyxml2'),
81 ],
82 install: true
83)
84
85executable(
86 'phosphor-unit-failure-monitor',
87 [
88 'fail-monitor/argument.cpp',
89 'fail-monitor/main.cpp',
90 'fail-monitor/monitor.cpp',
91 ],
92 dependencies: [
93 phosphor_logging,
94 ],
95 install: true
96)