meson: reformat with meson formatter
Apply the `meson format` results.
Change-Id: I32738d2651952ca65b95ddb98d18acf6f11f4c2e
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/meson.build b/meson.build
index a22ec18..ef6feed 100644
--- a/meson.build
+++ b/meson.build
@@ -1,13 +1,14 @@
project(
- 'openpower-occ-control', 'cpp',
- version : '1.0.0',
+ 'openpower-occ-control',
+ 'cpp',
+ version: '1.0.0',
meson_version: '>=1.1.1',
default_options: [
'warning_level=3',
'werror=true',
'cpp_std=c++23',
- 'buildtype=debugoptimized'
- ]
+ 'buildtype=debugoptimized',
+ ],
)
cxx = meson.get_compiler('cpp')
@@ -20,8 +21,14 @@
conf_data.set_quoted('OCC_NAME', 'occ')
conf_data.set_quoted('OCC_MASTER_NAME', 'occ-hwmon.1')
conf_data.set_quoted('OCC_DEV_PATH', '/dev/occ')
-conf_data.set_quoted('CPU_SUBPATH', '/xyz/openbmc_project/inventory/system/chassis/motherboard')
-conf_data.set_quoted('OCC_CONTROL_PERSIST_PATH', '/var/lib/openpower-occ-control')
+conf_data.set_quoted(
+ 'CPU_SUBPATH',
+ '/xyz/openbmc_project/inventory/system/chassis/motherboard',
+)
+conf_data.set_quoted(
+ 'OCC_CONTROL_PERSIST_PATH',
+ '/var/lib/openpower-occ-control',
+)
conf_data.set_quoted('OP_DUMP_OBJ_PATH', get_option('op_dump_obj_path'))
conf_data.set('MAX_CPUS', get_option('max-cpus'))
@@ -34,13 +41,16 @@
conf_data.set_quoted('DEV_PATH', '/sys/bus/i2c/devices')
conf_data.set_quoted('I2C_OCC_DEVICE_NAME', 'p8-occ-hwmon')
else
- conf_data.set_quoted('OCC_HWMON_PATH', '/sys/bus/platform/drivers/occ-hwmon/')
+ conf_data.set_quoted(
+ 'OCC_HWMON_PATH',
+ '/sys/bus/platform/drivers/occ-hwmon/',
+ )
conf_data.set_quoted('DEV_PATH', '/sys/bus/platform/devices/')
endif
conf_data.set('I2C_OCC', get_option('i2c-occ').allowed())
conf_data.set('READ_OCC_SENSORS', get_option('read-occ-sensors').allowed())
-conf_data.set('PLDM', get_option('with-host-communication-protocol')=='pldm')
+conf_data.set('PLDM', get_option('with-host-communication-protocol') == 'pldm')
conf_data.set('POWER10', get_option('power10-support').allowed())
conf_data.set('PHAL_SUPPORT', get_option('phal-support').allowed())
@@ -54,18 +64,16 @@
conf_data.set('PLDM_HAS_POLL', 1)
endif
-configure_file(output: 'config.h',
- configuration: conf_data
-)
+configure_file(output: 'config.h', configuration: conf_data)
-install_data('occ-active.sh',
+install_data(
+ 'occ-active.sh',
install_mode: 'rwxr-xr-x',
- install_dir: get_option('bindir')
+ install_dir: get_option('bindir'),
)
systemd = dependency('systemd')
-systemd_system_unit_dir = systemd.get_variable(
- 'systemdsystemunitdir')
+systemd_system_unit_dir = systemd.get_variable('systemdsystemunitdir')
subdir('service_files')
sdbusplus_dep = dependency('sdbusplus')
@@ -80,14 +88,16 @@
'cereal/cereal.hpp',
'cereal::specialize',
dependencies: cereal_dep,
- required: false)
+ required: false,
+)
if not has_cereal
cereal_opts = import('cmake').subproject_options()
cereal_opts.add_cmake_defines({'BUILD_TESTS': 'OFF'})
cereal_proj = import('cmake').subproject(
'cereal',
options: cereal_opts,
- required: false)
+ required: false,
+ )
assert(cereal_proj.found(), 'cereal is required')
cereal_dep = cereal_proj.dependency('cereal')
endif
@@ -122,32 +132,20 @@
'utils.cpp',
]
-if get_option('with-host-communication-protocol')=='pldm'
+if get_option('with-host-communication-protocol') == 'pldm'
libpldm_dep = dependency('libpldm')
- deps += [
- libpldm_dep
- ]
- sources += [
- 'pldm.cpp'
- ]
+ deps += [libpldm_dep]
+ sources += ['pldm.cpp']
endif
if get_option('power10-support').allowed()
libpldm_dep = dependency('libpldm')
- deps += [
- libpldm_dep
- ]
- sources += [
- 'pldm.cpp',
- 'powermode.cpp',
- ]
+ deps += [libpldm_dep]
+ sources += ['pldm.cpp', 'powermode.cpp']
endif
if get_option('phal-support').allowed()
- deps += [
- cxx.find_library('pdbg'),
- cxx.find_library('phal')
- ]
+ deps += [cxx.find_library('pdbg'), cxx.find_library('phal')]
endif
yamldir = get_option('yamldir')
@@ -158,24 +156,26 @@
# Generate occ-sensor.hpp.
occ_sensor_hpp = custom_target(
'occ-sensor.hpp',
- command : [
+ command: [
python_prog,
meson.project_source_root() + '/sensor_gen.py',
- '-i', yamldir,
+ '-i',
+ yamldir,
],
- output : 'occ-sensor.hpp')
- sources += [occ_sensor_hpp]
+ output: 'occ-sensor.hpp',
+)
+sources += [occ_sensor_hpp]
- executable(
- 'openpower-occ-control',
- sources,
- include_directories: '.',
- implicit_include_directories: true,
- dependencies: deps,
- install: true,
- install_dir: get_option('bindir')
- )
+executable(
+ 'openpower-occ-control',
+ sources,
+ include_directories: '.',
+ implicit_include_directories: true,
+ dependencies: deps,
+ install: true,
+ install_dir: get_option('bindir'),
+)
if get_option('tests').allowed()
- subdir('test')
+ subdir('test')
endif
diff --git a/meson.options b/meson.options
index d7eab4a..c20db63 100644
--- a/meson.options
+++ b/meson.options
@@ -1,77 +1,75 @@
-option(
- 'tests',
- type : 'feature',
- description : 'Build tests'
-)
+option('tests', type: 'feature', description: 'Build tests')
option(
'i2c-occ',
- type : 'feature',
- description : 'Enable I2C OCC support',
- value: 'disabled'
+ type: 'feature',
+ description: 'Enable I2C OCC support',
+ value: 'disabled',
)
option(
'read-occ-sensors',
- type : 'feature',
- description : 'Enable read occ sensors support',
- value: 'enabled'
+ type: 'feature',
+ description: 'Enable read occ sensors support',
+ value: 'enabled',
)
option(
'max-cpus',
- type : 'integer',
- min:0, max:255,
- description : 'Maximum number of CPUs',
- value: 2
+ type: 'integer',
+ min: 0,
+ max: 255,
+ description: 'Maximum number of CPUs',
+ value: 2,
)
option(
'ps-derating-factor',
- type : 'integer',
- min:0, max:100,
- description : 'Power supply derating factor',
- value: 90
+ type: 'integer',
+ min: 0,
+ max: 100,
+ description: 'Power supply derating factor',
+ value: 90,
)
option(
'with-host-communication-protocol',
- type : 'string',
- description : 'To specify the host communication protocol',
- value: 'pldm'
+ type: 'string',
+ description: 'To specify the host communication protocol',
+ value: 'pldm',
)
option(
'power10-support',
- type : 'feature',
- description : 'Enable Power10 support',
- value: 'enabled'
+ type: 'feature',
+ description: 'Enable Power10 support',
+ value: 'enabled',
)
option(
'yamldir',
- type : 'string',
- description : 'The path to the yaml config files'
+ type: 'string',
+ description: 'The path to the yaml config files',
)
option(
'op_dump_obj_path',
type: 'string',
value: '/org/openpower/dump',
- description : 'Object path requesting OpenPOWER dumps'
+ description: 'Object path requesting OpenPOWER dumps',
)
option(
'transport-implementation',
type: 'combo',
choices: ['mctp-demux', 'af-mctp'],
- description: 'transport via af-mctp or mctp-demux'
+ description: 'transport via af-mctp or mctp-demux',
)
option(
'phal-support',
- type : 'feature',
- description : 'Enable PHAL support',
- value: 'disabled'
+ type: 'feature',
+ description: 'Enable PHAL support',
+ value: 'disabled',
)
diff --git a/service_files/meson.build b/service_files/meson.build
index 56acbc5..099a735 100644
--- a/service_files/meson.build
+++ b/service_files/meson.build
@@ -1,14 +1,10 @@
unit_files = [
- 'org.open_power.OCC.Control.service',
- 'op-occ-disable@.service',
- 'op-occ-enable@.service'
+ 'org.open_power.OCC.Control.service',
+ 'op-occ-disable@.service',
+ 'op-occ-enable@.service',
]
fs = import('fs')
foreach u : unit_files
- fs.copyfile(
- u,
- install: true,
- install_dir: systemd_system_unit_dir
- )
+ fs.copyfile(u, install: true, install_dir: systemd_system_unit_dir)
endforeach
diff --git a/test/meson.build b/test/meson.build
index 440bec1..f54bbcc 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -8,63 +8,60 @@
dependency('threads'),
gtest_proj.dependency('gtest'),
gtest_proj.dependency('gtest_main'),
- ]
+ ],
)
gmock_dep = gtest_proj.dependency('gmock')
- else
+ else
assert(
not get_option('tests').allowed(),
- 'Googletest is required if tests are enabled'
+ 'Googletest is required if tests are enabled',
)
- endif
+ endif
endif
test_sources = [
- '../occ_pass_through.cpp',
- '../occ_manager.cpp',
- '../occ_status.cpp',
- '../occ_device.cpp',
- '../occ_errors.cpp',
- '../occ_ffdc.cpp',
- '../occ_presence.cpp',
- '../occ_command.cpp',
- '../occ_dbus.cpp',
- '../powercap.cpp',
- '../i2c_occ.cpp',
- '../utils.cpp',
- occ_sensor_hpp,
+ '../occ_pass_through.cpp',
+ '../occ_manager.cpp',
+ '../occ_status.cpp',
+ '../occ_device.cpp',
+ '../occ_errors.cpp',
+ '../occ_ffdc.cpp',
+ '../occ_presence.cpp',
+ '../occ_command.cpp',
+ '../occ_dbus.cpp',
+ '../powercap.cpp',
+ '../i2c_occ.cpp',
+ '../utils.cpp',
+ occ_sensor_hpp,
]
-if get_option('with-host-communication-protocol')=='pldm'
- test_sources += [
- '../pldm.cpp',
- ]
+if get_option('with-host-communication-protocol') == 'pldm'
+ test_sources += ['../pldm.cpp']
endif
if get_option('power10-support').allowed()
- test_sources += [
- '../powermode.cpp',
- ]
+ test_sources += ['../powermode.cpp']
endif
tests = [
- 'error_files_tests.cpp',
- 'occ_dbus_test.cpp',
- 'TestI2cOcc.cpp',
- 'utest.cpp',
+ 'error_files_tests.cpp',
+ 'occ_dbus_test.cpp',
+ 'TestI2cOcc.cpp',
+ 'utest.cpp',
]
pthread_dep = dependency('threads')
foreach t : tests
- test(t, executable(t.underscorify(), t,
- test_sources,
- include_directories: '..',
- dependencies: [
- gtest_dep,
- gmock_dep,
- pthread_dep,
- deps
- ]),
- workdir: meson.current_source_dir())
+ test(
+ t,
+ executable(
+ t.underscorify(),
+ t,
+ test_sources,
+ include_directories: '..',
+ dependencies: [gtest_dep, gmock_dep, pthread_dep, deps],
+ ),
+ workdir: meson.current_source_dir(),
+ )
endforeach