Skip to content

Commit 37304f0

Browse files
meson: reformat with meson formatter
Apply the `meson format` results. Change-Id: Iab5fdd6b41eab1cc138df39f1dce5345bf260306 Signed-off-by: Patrick Williams <[email protected]>
1 parent 241f51d commit 37304f0

File tree

5 files changed

+63
-71
lines changed

5 files changed

+63
-71
lines changed

meson.build

Lines changed: 27 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
project(
22
'entity-manager',
33
'cpp',
4-
default_options: [
5-
'warning_level=3',
6-
'werror=true',
7-
'cpp_std=c++23'
8-
],
4+
default_options: ['warning_level=3', 'werror=true', 'cpp_std=c++23'],
95
license: 'Apache-2.0',
106
version: '0.1',
117
meson_version: '>=1.1.1',
@@ -19,24 +15,25 @@ boost_args = [
1915
'-DBOOST_NO_RTTI',
2016
'-DBOOST_NO_TYPEID',
2117
'-DBOOST_ALL_NO_LIB',
22-
'-DBOOST_ALLOW_DEPRECATED_HEADERS'
18+
'-DBOOST_ALLOW_DEPRECATED_HEADERS',
2319
]
2420
build_tests = get_option('tests')
2521
cpp = meson.get_compiler('cpp')
2622
boost = dependency('boost', required: false)
2723
if not boost.found()
28-
subproject('boost', required: false)
29-
boost = declare_dependency(
30-
include_directories: 'subprojects/boost_1_71_0',
31-
)
32-
boost = boost.as_system('system')
24+
subproject('boost', required: false)
25+
boost = declare_dependency(include_directories: 'subprojects/boost_1_71_0')
26+
boost = boost.as_system('system')
3327
endif
3428
if get_option('fru-device')
3529
i2c = cpp.find_library('i2c')
3630
endif
3731

3832
if get_option('devicetree-vpd')
39-
phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces', include_type: 'system')
33+
phosphor_dbus_interfaces_dep = dependency(
34+
'phosphor-dbus-interfaces',
35+
include_type: 'system',
36+
)
4037
endif
4138

4239
nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
@@ -46,7 +43,8 @@ phosphor_logging_dep = dependency('phosphor-logging')
4643
systemd = dependency('systemd')
4744
systemd_system_unit_dir = systemd.get_variable(
4845
'systemdsystemunitdir',
49-
pkgconfig_define: ['prefix', get_option('prefix')])
46+
pkgconfig_define: ['prefix', get_option('prefix')],
47+
)
5048
packagedir = join_paths(
5149
get_option('prefix'),
5250
get_option('datadir'),
@@ -63,7 +61,7 @@ if cpp.has_header('valijson/validator.hpp')
6361
else
6462
subproject('valijson', required: false)
6563
valijson = declare_dependency(
66-
include_directories: 'subprojects/valijson/include'
64+
include_directories: 'subprojects/valijson/include',
6765
)
6866
valijson = valijson.as_system('system')
6967
endif
@@ -76,29 +74,19 @@ subdir('configurations')
7674
filepaths = []
7775
foreach c : configs
7876
file = join_paths('configurations', c)
79-
install_data(
80-
file,
81-
install_dir: join_paths(
82-
packagedir,
83-
'configurations',
84-
)
85-
)
77+
install_data(file, install_dir: join_paths(packagedir, 'configurations'))
8678
filepaths += [file]
8779
endforeach
8880

8981
if get_option('validate-json')
9082
validate_script = files('scripts/validate_configs.py')
9183
autojson = custom_target(
92-
'check_syntax',
93-
command: [
94-
validate_script,
95-
'-v',
96-
'-k',
97-
],
98-
depend_files: files(filepaths),
99-
build_by_default: true,
100-
capture: true,
101-
output: 'validate_configs.log',
84+
'check_syntax',
85+
command: [validate_script, '-v', '-k'],
86+
depend_files: files(filepaths),
87+
build_by_default: true,
88+
capture: true,
89+
output: 'validate_configs.log',
10290
)
10391
endif
10492

@@ -121,11 +109,7 @@ schemas = [
121109
foreach s : schemas
122110
install_data(
123111
join_paths('schemas', s),
124-
install_dir: join_paths(
125-
packagedir,
126-
'configurations',
127-
'schemas',
128-
)
112+
install_dir: join_paths(packagedir, 'configurations', 'schemas'),
129113
)
130114
endforeach
131115

@@ -141,7 +125,9 @@ if not build_tests.disabled()
141125
gtest_subproject = cmake.subproject('gtest')
142126
cm_gtest = gtest_subproject.dependency('gtest')
143127
cm_gtest_main = gtest_subproject.dependency('gtest_main')
144-
gtest = declare_dependency(dependencies: [cm_gtest, cm_gtest_main, threads])
128+
gtest = declare_dependency(
129+
dependencies: [cm_gtest, cm_gtest_main, threads],
130+
)
145131
gmock = gtest_subproject.dependency('gmock')
146132

147133
endif
@@ -163,7 +149,7 @@ if not build_tests.disabled()
163149
valijson,
164150
],
165151
include_directories: 'src',
166-
)
152+
),
167153
)
168154

169155
test(
@@ -174,14 +160,9 @@ if not build_tests.disabled()
174160
'src/fru_utils.cpp',
175161
'src/fru_reader.cpp',
176162
cpp_args: test_boost_args,
177-
dependencies: [
178-
boost,
179-
gtest,
180-
phosphor_logging_dep,
181-
sdbusplus,
182-
],
163+
dependencies: [boost, gtest, phosphor_logging_dep, sdbusplus],
183164
include_directories: 'src',
184-
)
165+
),
185166
)
186167

187168
test(
@@ -198,6 +179,6 @@ if not build_tests.disabled()
198179
phosphor_logging_dep,
199180
],
200181
include_directories: 'src',
201-
)
182+
),
202183
)
203184
endif

meson.options

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
option('tests', type: 'feature', description: 'Build tests.')
2+
option(
3+
'fru-device',
4+
type: 'boolean',
5+
description: 'Build fru-device VPD parser.',
6+
)
7+
option(
8+
'fru-device-resizefru',
9+
value: false,
10+
type: 'boolean',
11+
description: 'Allow FruDevice to resize FRU areas.',
12+
)
13+
option(
14+
'fru-device-16bitdetectmode',
15+
type: 'combo',
16+
choices: ['MODE_1', 'MODE_2'],
17+
value: 'MODE_1',
18+
description: 'Different modes to detect 16-bit address EEPROM devices. MODE_1 is current and default mode.',
19+
)
20+
option(
21+
'devicetree-vpd',
22+
type: 'boolean',
23+
description: 'Build device-tree VPD parser',
24+
)
25+
option(
26+
'validate-json',
27+
type: 'boolean',
28+
value: true,
29+
description: 'Run JSON schema validation during the build.',
30+
)

meson_options.txt

Lines changed: 0 additions & 18 deletions
This file was deleted.

service_files/meson.build

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ endforeach
1818

1919
dbus_system_bus_services_dir = dependency('dbus-1').get_variable(
2020
'system_bus_services_dir',
21-
pkgconfig_define: ['prefix', get_option('prefix')])
21+
pkgconfig_define: ['prefix', get_option('prefix')],
22+
)
2223
install_data(
2324
'dbus/xyz.openbmc_project.EntityManager.service',
24-
install_dir: dbus_system_bus_services_dir)
25+
install_dir: dbus_system_bus_services_dir,
26+
)

src/meson.build

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cpp_args = boost_args + ['-DPACKAGE_DIR="' + packagedir + '/"']
2-
cpp_args += ['-DSYSCONF_DIR="' + sysconfdir + '/"' ]
2+
cpp_args += ['-DSYSCONF_DIR="' + sysconfdir + '/"']
33
installdir = join_paths(get_option('libexecdir'), 'entity-manager')
44

55
executable(
@@ -59,10 +59,7 @@ if get_option('devicetree-vpd')
5959
'machine_context.cpp',
6060
'devicetree_vpd_parser.cpp',
6161
cpp_args: cpp_args_fd,
62-
dependencies: [
63-
sdbusplus,
64-
phosphor_dbus_interfaces_dep,
65-
],
62+
dependencies: [sdbusplus, phosphor_dbus_interfaces_dep],
6663
install: true,
6764
install_dir: installdir,
6865
)

0 commit comments

Comments
 (0)