Format meson files with meson.format
Meson 1.5.0 introduced a new feature to format all the meson
files. Formatting all the meson files is now as simple as running
`meson format -i -r` command in the repository root folder.
more details : https://mesonbuild.com/Commands.html#format
Change-Id: I9c5468cc502ae78b7a055e2de2a10296930cb9ec
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
diff --git a/meson.build b/meson.build
index e8c3bc8..e722bec 100644
--- a/meson.build
+++ b/meson.build
@@ -1,12 +1,16 @@
-project('pldm', ['c', 'cpp'],
- version: '0.1', meson_version: '>=1.1.1',
- default_options: [
- 'warning_level=3',
- 'default_library=shared',
- 'werror=true',
- 'cpp_std=c++23',
- 'buildtype=debugoptimized'
- ])
+project(
+ 'pldm',
+ ['c', 'cpp'],
+ version: '0.1',
+ meson_version: '>=1.1.1',
+ default_options: [
+ 'warning_level=3',
+ 'default_library=shared',
+ 'werror=true',
+ 'cpp_std=c++23',
+ 'buildtype=debugoptimized',
+ ],
+)
# Wno-psabi reduces the number of "Note:" messages when cross-compiling some STL
# stuff for ARM. See https://stackoverflow.com/questions/48149323/strange-gcc-warning-when-compiling-qt-project
@@ -16,13 +20,21 @@
# Disable FORTIFY_SOURCE when compiling with no optimization
-if(get_option('optimization') == '0')
- add_project_arguments('-U_FORTIFY_SOURCE',language:['cpp','c'])
- message('Disabling FORTIFY_SOURCE as optimization is set to 0')
+if (get_option('optimization') == '0')
+ add_project_arguments('-U_FORTIFY_SOURCE', language: ['cpp', 'c'])
+ message('Disabling FORTIFY_SOURCE as optimization is set to 0')
endif
-package_datadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
-package_localstatedir = join_paths(get_option('prefix'), get_option('localstatedir'), meson.project_name())
+package_datadir = join_paths(
+ get_option('prefix'),
+ get_option('datadir'),
+ meson.project_name(),
+)
+package_localstatedir = join_paths(
+ get_option('prefix'),
+ get_option('localstatedir'),
+ meson.project_name(),
+)
conf_data = configuration_data()
cpp = meson.get_compiler('cpp')
@@ -32,54 +44,107 @@
conf_data.set('PLDM_HAS_POLL', 1)
endif
if get_option('libpldmresponder').allowed()
-conf_data.set_quoted('BIOS_JSONS_DIR', join_paths(package_datadir, 'bios'))
-conf_data.set('SYSTEM_SPECIFIC_BIOS_JSON', get_option('system-specific-bios-json').allowed())
-conf_data.set_quoted('BIOS_TABLES_DIR', join_paths(package_localstatedir, 'bios'))
-conf_data.set_quoted('PDR_JSONS_DIR', join_paths(package_datadir, 'pdr'))
-conf_data.set_quoted('FRU_JSONS_DIR', join_paths(package_datadir, 'fru'))
-conf_data.set_quoted('FRU_MASTER_JSON', join_paths(package_datadir, 'fru_master.json'))
-conf_data.set_quoted('ENTITY_MAP_JSON', join_paths(package_datadir, 'entityMap.json'))
-conf_data.set_quoted('HOST_JSONS_DIR', join_paths(package_datadir, 'host'))
-conf_data.set_quoted('EVENTS_JSONS_DIR', join_paths(package_datadir, 'events'))
-conf_data.set('HEARTBEAT_TIMEOUT', get_option('heartbeat-timeout-seconds'))
-conf_data.set('TERMINUS_ID', get_option('terminus-id'))
-conf_data.set('TERMINUS_HANDLE',get_option('terminus-handle'))
-conf_data.set('DBUS_TIMEOUT', get_option('dbus-timeout-value'))
-add_project_arguments('-DLIBPLDMRESPONDER', language : ['c','cpp'])
+ conf_data.set_quoted('BIOS_JSONS_DIR', join_paths(package_datadir, 'bios'))
+ conf_data.set(
+ 'SYSTEM_SPECIFIC_BIOS_JSON',
+ get_option('system-specific-bios-json').allowed(),
+ )
+ conf_data.set_quoted(
+ 'BIOS_TABLES_DIR',
+ join_paths(package_localstatedir, 'bios'),
+ )
+ conf_data.set_quoted('PDR_JSONS_DIR', join_paths(package_datadir, 'pdr'))
+ conf_data.set_quoted('FRU_JSONS_DIR', join_paths(package_datadir, 'fru'))
+ conf_data.set_quoted(
+ 'FRU_MASTER_JSON',
+ join_paths(package_datadir, 'fru_master.json'),
+ )
+ conf_data.set_quoted(
+ 'ENTITY_MAP_JSON',
+ join_paths(package_datadir, 'entityMap.json'),
+ )
+ conf_data.set_quoted('HOST_JSONS_DIR', join_paths(package_datadir, 'host'))
+ conf_data.set_quoted(
+ 'EVENTS_JSONS_DIR',
+ join_paths(package_datadir, 'events'),
+ )
+ conf_data.set('HEARTBEAT_TIMEOUT', get_option('heartbeat-timeout-seconds'))
+ conf_data.set('TERMINUS_ID', get_option('terminus-id'))
+ conf_data.set('TERMINUS_HANDLE', get_option('terminus-handle'))
+ conf_data.set('DBUS_TIMEOUT', get_option('dbus-timeout-value'))
+ add_project_arguments('-DLIBPLDMRESPONDER', language: ['c', 'cpp'])
endif
if get_option('softoff').allowed()
- conf_data.set('SOFTOFF_TIMEOUT_SECONDS', get_option('softoff-timeout-seconds'))
- conf_data.set_quoted('SOFTOFF_CONFIG_JSON', join_paths(package_datadir, 'softoff'))
+ conf_data.set(
+ 'SOFTOFF_TIMEOUT_SECONDS',
+ get_option('softoff-timeout-seconds'),
+ )
+ conf_data.set_quoted(
+ 'SOFTOFF_CONFIG_JSON',
+ join_paths(package_datadir, 'softoff'),
+ )
endif
if get_option('oem-ibm').allowed()
- conf_data.set_quoted('FILE_TABLE_JSON', join_paths(package_datadir, 'fileTable.json'))
- conf_data.set_quoted('LID_RUNNING_DIR', '/var/lib/phosphor-software-manager/hostfw/running')
- conf_data.set_quoted('LID_ALTERNATE_DIR', '/var/lib/phosphor-software-manager/hostfw/alternate')
- conf_data.set_quoted('LID_STAGING_DIR', '/var/lib/phosphor-software-manager/hostfw/staging')
- conf_data.set_quoted('LID_RUNNING_PATCH_DIR', '/usr/local/share/hostfw/running')
- conf_data.set_quoted('LID_ALTERNATE_PATCH_DIR', '/usr/local/share/hostfw/alternate')
- conf_data.set('DMA_MAXSIZE', get_option('oem-ibm-dma-maxsize'))
- add_project_arguments('-DOEM_IBM', language : ['c', 'cpp'])
+ conf_data.set_quoted(
+ 'FILE_TABLE_JSON',
+ join_paths(package_datadir, 'fileTable.json'),
+ )
+ conf_data.set_quoted(
+ 'LID_RUNNING_DIR',
+ '/var/lib/phosphor-software-manager/hostfw/running',
+ )
+ conf_data.set_quoted(
+ 'LID_ALTERNATE_DIR',
+ '/var/lib/phosphor-software-manager/hostfw/alternate',
+ )
+ conf_data.set_quoted(
+ 'LID_STAGING_DIR',
+ '/var/lib/phosphor-software-manager/hostfw/staging',
+ )
+ conf_data.set_quoted(
+ 'LID_RUNNING_PATCH_DIR',
+ '/usr/local/share/hostfw/running',
+ )
+ conf_data.set_quoted(
+ 'LID_ALTERNATE_PATCH_DIR',
+ '/usr/local/share/hostfw/alternate',
+ )
+ conf_data.set('DMA_MAXSIZE', get_option('oem-ibm-dma-maxsize'))
+ add_project_arguments('-DOEM_IBM', language: ['c', 'cpp'])
endif
-conf_data.set('NUMBER_OF_REQUEST_RETRIES', get_option('number-of-request-retries'))
-conf_data.set('INSTANCE_ID_EXPIRATION_INTERVAL',get_option('instance-id-expiration-interval'))
-conf_data.set('RESPONSE_TIME_OUT',get_option('response-time-out'))
-conf_data.set('FLIGHT_RECORDER_MAX_ENTRIES',get_option('flightrecorder-max-entries'))
+conf_data.set(
+ 'NUMBER_OF_REQUEST_RETRIES',
+ get_option('number-of-request-retries'),
+)
+conf_data.set(
+ 'INSTANCE_ID_EXPIRATION_INTERVAL',
+ get_option('instance-id-expiration-interval'),
+)
+conf_data.set('RESPONSE_TIME_OUT', get_option('response-time-out'))
+conf_data.set(
+ 'FLIGHT_RECORDER_MAX_ENTRIES',
+ get_option('flightrecorder-max-entries'),
+)
conf_data.set_quoted('HOST_EID_PATH', join_paths(package_datadir, 'host_eid'))
conf_data.set('MAXIMUM_TRANSFER_SIZE', get_option('maximum-transfer-size'))
if get_option('transport-implementation') == 'mctp-demux'
- conf_data.set('PLDM_TRANSPORT_WITH_MCTP_DEMUX', 1)
+ conf_data.set('PLDM_TRANSPORT_WITH_MCTP_DEMUX', 1)
elif get_option('transport-implementation') == 'af-mctp'
- conf_data.set('PLDM_TRANSPORT_WITH_AF_MCTP', 1)
+ conf_data.set('PLDM_TRANSPORT_WITH_AF_MCTP', 1)
endif
-conf_data.set('DEFAULT_SENSOR_UPDATER_INTERVAL', get_option('default-sensor-update-interval'))
+conf_data.set(
+ 'DEFAULT_SENSOR_UPDATER_INTERVAL',
+ get_option('default-sensor-update-interval'),
+)
conf_data.set('SENSOR_POLLING_TIME', get_option('sensor-polling-time'))
-configure_file(output: 'config.h',
- configuration: conf_data
-)
+configure_file(output: 'config.h', configuration: conf_data)
-add_project_arguments('-include', '@0@'.format(meson.current_build_dir() /'config.h'), language: 'cpp')
+add_project_arguments(
+ '-include',
+ '@0@'.format(meson.current_build_dir() / 'config.h'),
+ language: 'cpp',
+)
filesystem = import('fs')
@@ -92,9 +157,9 @@
nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
if cpp.has_header('CLI/CLI.hpp')
- CLI11_dep = declare_dependency()
+ CLI11_dep = declare_dependency()
else
- CLI11_dep = dependency('CLI11')
+ CLI11_dep = dependency('CLI11')
endif
if get_option('tests').allowed()
@@ -108,95 +173,100 @@
dependency('threads'),
gtest_proj.dependency('gtest'),
gtest_proj.dependency('gtest_main'),
- ]
+ ],
)
gmock = gtest_proj.dependency('gmock')
else
assert(
not get_option('tests').allowed(),
- 'Googletest is required if tests are enabled'
+ 'Googletest is required if tests are enabled',
)
endif
endif
endif
-libpldm_dep = dependency('libpldm', fallback:['libpldm','libpldm_dep'], include_type: 'system')
+libpldm_dep = dependency(
+ 'libpldm',
+ fallback: ['libpldm', 'libpldm_dep'],
+ include_type: 'system',
+)
libpldmutils_headers = ['.']
libpldmutils = library(
- 'pldmutils',
- 'common/transport.cpp',
- 'common/utils.cpp',
- version: meson.project_version(),
- dependencies: [
- libpldm_dep,
- phosphor_dbus_interfaces,
- phosphor_logging_dep,
- nlohmann_json_dep,
- sdbusplus,
- ],
- install: true,
- include_directories: include_directories(libpldmutils_headers),
+ 'pldmutils',
+ 'common/transport.cpp',
+ 'common/utils.cpp',
+ version: meson.project_version(),
+ dependencies: [
+ libpldm_dep,
+ phosphor_dbus_interfaces,
+ phosphor_logging_dep,
+ nlohmann_json_dep,
+ sdbusplus,
+ ],
+ install: true,
+ include_directories: include_directories(libpldmutils_headers),
)
libpldmutils = declare_dependency(
- include_directories: include_directories(libpldmutils_headers),
- link_with: libpldmutils)
+ include_directories: include_directories(libpldmutils_headers),
+ link_with: libpldmutils,
+)
deps = [
- libpldm_dep,
- libpldmutils,
- nlohmann_json_dep,
- phosphor_dbus_interfaces,
- phosphor_logging_dep,
- sdbusplus,
- sdeventplus,
- stdplus,
+ libpldm_dep,
+ libpldmutils,
+ nlohmann_json_dep,
+ phosphor_dbus_interfaces,
+ phosphor_logging_dep,
+ sdbusplus,
+ sdeventplus,
+ stdplus,
]
if get_option('libpldmresponder').allowed()
-subdir('libpldmresponder')
-deps += [
- libpldmresponder_dep
-]
+ subdir('libpldmresponder')
+ deps += [libpldmresponder_dep]
endif
executable(
- 'pldmd',
- 'pldmd/pldmd.cpp',
- 'pldmd/dbus_impl_pdr.cpp',
- 'fw-update/activation.cpp',
- 'fw-update/inventory_manager.cpp',
- 'fw-update/package_parser.cpp',
- 'fw-update/device_updater.cpp',
- 'fw-update/watch.cpp',
- 'fw-update/update_manager.cpp',
- 'platform-mc/terminus_manager.cpp',
- 'platform-mc/terminus.cpp',
- 'platform-mc/platform_manager.cpp',
- 'platform-mc/manager.cpp',
- 'platform-mc/sensor_manager.cpp',
- 'platform-mc/numeric_sensor.cpp',
- 'requester/mctp_endpoint_discovery.cpp',
- implicit_include_directories: false,
- dependencies: deps,
- install: true,
- install_dir: get_option('bindir'))
+ 'pldmd',
+ 'pldmd/pldmd.cpp',
+ 'pldmd/dbus_impl_pdr.cpp',
+ 'fw-update/activation.cpp',
+ 'fw-update/inventory_manager.cpp',
+ 'fw-update/package_parser.cpp',
+ 'fw-update/device_updater.cpp',
+ 'fw-update/watch.cpp',
+ 'fw-update/update_manager.cpp',
+ 'platform-mc/terminus_manager.cpp',
+ 'platform-mc/terminus.cpp',
+ 'platform-mc/platform_manager.cpp',
+ 'platform-mc/manager.cpp',
+ 'platform-mc/sensor_manager.cpp',
+ 'platform-mc/numeric_sensor.cpp',
+ 'requester/mctp_endpoint_discovery.cpp',
+ implicit_include_directories: false,
+ dependencies: deps,
+ install: true,
+ install_dir: get_option('bindir'),
+)
if get_option('systemd').allowed()
- systemd_system_unit_dir = dependency('systemd').get_variable(
- 'systemdsystemunitdir')
- filesystem.copyfile(
- 'pldmd/service_files/pldmd.service',
- 'pldmd.service',
- install: true,
- install_dir: systemd_system_unit_dir
- )
+ systemd_system_unit_dir = dependency('systemd').get_variable(
+ 'systemdsystemunitdir',
+ )
+ filesystem.copyfile(
+ 'pldmd/service_files/pldmd.service',
+ 'pldmd.service',
+ install: true,
+ install_dir: systemd_system_unit_dir,
+ )
- if get_option('oem-ibm').allowed()
- subdir('oem/ibm/service_files')
- endif
+ if get_option('oem-ibm').allowed()
+ subdir('oem/ibm/service_files')
+ endif
endif
subdir('pldmtool')
@@ -204,18 +274,18 @@
subdir('configurations')
if get_option('utilities').allowed()
- subdir('utilities')
+ subdir('utilities')
endif
if get_option('softoff').allowed()
- subdir('softoff')
+ subdir('softoff')
endif
if get_option('tests').allowed()
- subdir('common/test')
- subdir('fw-update/test')
- subdir('host-bmc/test')
- subdir('requester/test')
- subdir('platform-mc/test')
- subdir('test')
+ subdir('common/test')
+ subdir('fw-update/test')
+ subdir('host-bmc/test')
+ subdir('requester/test')
+ subdir('platform-mc/test')
+ subdir('test')
endif