blob: ef744e6479c8e39b9d7d9418963570f13e584dfd [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
48conf = configuration_data()
49conf.set_quoted('MAPPER_BUSNAME', 'xyz.openbmc_project.ObjectMapper')
50conf.set_quoted('MAPPER_INTERFACE', 'xyz.openbmc_project.ObjectMapper')
51conf.set_quoted('MAPPER_PATH', '/xyz/openbmc_project/object_mapper')
52configure_file(output: 'config.h', configuration: conf)
53
54install_headers('libmapper/mapper.h')
55
56libmapper = library(
57 'mapper',
58 'libmapper/mapper.c',
59 dependencies: [ dependency('libsystemd') ],
60 gnu_symbol_visibility: 'hidden',
61 version: meson.project_version(),
62 install: true)
63
64import('pkgconfig').generate(
65 name: 'libmapper',
66 description: 'OpenBMC service discovery utility library',
67 version: meson.project_version(),
68 libraries: libmapper)
69
70executable(
71 'mapper',
72 'libmapper/app.c',
73 link_with: libmapper,
74 dependencies: [ dependency('libsystemd') ],
75 install: true)
76
77executable(
78 'mapperx',
79 [
80 'src/main.cpp',
81 'src/argument.cpp',
82 'src/processing.cpp',
83 'src/associations.cpp',
84 ],
85 dependencies: [
86 dependency('boost'),
87 dependency('libsystemd'),
88 phosphor_logging,
89 sdbusplus,
90 dependency('systemd'),
91 dependency('threads'),
92 dependency('tinyxml2'),
93 ],
94 install: true
95)
96
97executable(
98 'phosphor-unit-failure-monitor',
99 [
100 'fail-monitor/argument.cpp',
101 'fail-monitor/main.cpp',
102 'fail-monitor/monitor.cpp',
103 ],
104 dependencies: [
105 phosphor_logging,
106 ],
107 install: true
108)