blob: 3c536afce20853fb1d45f0cd0682462ea77458b0 [file] [log] [blame]
Brad Bishop0aa15902019-05-08 21:30:01 -04001project(
2 'phosphor-objmgr',
3 'c', 'cpp',
4 default_options: [
5 'cpp_std=c++17',
6 'warning_level=3',
7 'werror=true',
8 ],
9 license: 'Apache-2.0',
10 version: '1.0',
11)
12
13phosphor_logging = dependency(
14 'phosphor-logging',
15 fallback: [
16 'phosphor-logging',
17 'phosphor_logging_dep'])
18sdbusplus = dependency(
19 'sdbusplus',
20 fallback: ['sdbusplus', 'sdbusplus_dep'])
21
22if get_option('tests').enabled()
23 gtest = dependency('gtest', main: true, disabler: true, required: false)
24 gmock = dependency('gmock', disabler: true, required: false)
25 if not gtest.found() or not gmock.found()
26 gtest_proj = import('cmake').subproject('googletest', required: false)
27 if gtest_proj.found()
28 gtest = declare_dependency(
29 dependencies: [
30 dependency('threads'),
31 gtest_proj.dependency('gtest'),
32 gtest_proj.dependency('gtest_main'),
33 ]
34 )
35 gmock = gtest_proj.dependency('gmock')
36 else
37 assert(
38 not get_option('tests').enabled(),
39 'Googletest is required if tests are enabled'
40 )
41 endif
42 endif
43 subdir('src/test')
44 subdir('libmapper/test')
45endif
46
47conf = configuration_data()
48conf.set_quoted('MAPPER_BUSNAME', 'xyz.openbmc_project.ObjectMapper')
49conf.set_quoted('MAPPER_INTERFACE', 'xyz.openbmc_project.ObjectMapper')
50conf.set_quoted('MAPPER_PATH', '/xyz/openbmc_project/object_mapper')
51configure_file(output: 'config.h', configuration: conf)
52
53install_headers('libmapper/mapper.h')
54
55libmapper = library(
56 'mapper',
57 'libmapper/mapper.c',
58 dependencies: [ dependency('libsystemd') ],
59 gnu_symbol_visibility: 'hidden',
60 version: meson.project_version(),
61 install: true)
62
63import('pkgconfig').generate(
64 name: 'libmapper',
65 description: 'OpenBMC service discovery utility library',
66 version: meson.project_version(),
67 libraries: libmapper)
68
69executable(
70 'mapper',
71 'libmapper/app.c',
72 link_with: libmapper,
73 dependencies: [ dependency('libsystemd') ],
74 install: true)
75
76executable(
77 'mapperx',
78 [
79 'src/main.cpp',
80 'src/argument.cpp',
81 'src/processing.cpp',
82 'src/associations.cpp',
83 ],
84 dependencies: [
85 dependency('boost'),
86 dependency('libsystemd'),
87 phosphor_logging,
88 sdbusplus,
89 dependency('systemd'),
90 dependency('threads'),
91 dependency('tinyxml2'),
92 ],
93 install: true
94)
95
96executable(
97 'phosphor-unit-failure-monitor',
98 [
99 'fail-monitor/argument.cpp',
100 'fail-monitor/main.cpp',
101 'fail-monitor/monitor.cpp',
102 ],
103 dependencies: [
104 phosphor_logging,
105 ],
106 install: true
107)