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