meson: reformat with meson formatter
Apply the `meson format` results.
Change-Id: I116103d8e0994e09ecb6381f5bb7d564608826b2
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/bmc/firmware-handler/meson.build b/bmc/firmware-handler/meson.build
index 2d935a3..42c14ba 100644
--- a/bmc/firmware-handler/meson.build
+++ b/bmc/firmware-handler/meson.build
@@ -3,124 +3,130 @@
# phosphor-ipmi-flash config
config_data = []
if get_option('update-type') == 'static-layout'
- if get_option('reboot-update')
- config_data += 'config-static-bmc-reboot.json'
- else
- if get_option('update-status')
- config_data += 'config-static-bmc-with-update-status.json'
+ if get_option('reboot-update')
+ config_data += 'config-static-bmc-reboot.json'
else
- config_data += 'config-static-bmc.json'
+ if get_option('update-status')
+ config_data += 'config-static-bmc-with-update-status.json'
+ else
+ config_data += 'config-static-bmc.json'
+ endif
endif
- endif
endif
if get_option('host-bios')
- config_data += 'config-bios.json'
+ config_data += 'config-bios.json'
endif
foreach data : config_data
- configure_file(
- input: data + '.in',
- output: data,
- configuration: conf_data,
- install: true,
- install_dir: get_option('datadir') / 'phosphor-ipmi-flash')
+ configure_file(
+ input: data + '.in',
+ output: data,
+ configuration: conf_data,
+ install: true,
+ install_dir: get_option('datadir') / 'phosphor-ipmi-flash',
+ )
endforeach
# temp files
install_data(
- 'phosphor-ipmi-flash.conf',
- install_dir: get_option('libdir') / 'tmpfiles.d')
+ 'phosphor-ipmi-flash.conf',
+ install_dir: get_option('libdir') / 'tmpfiles.d',
+)
# systemd configs
systemd_data = [
- 'phosphor-ipmi-flash-bmc-prepare.target',
- 'phosphor-ipmi-flash-bmc-verify.target',
- 'phosphor-ipmi-flash-bmc-update.target',
+ 'phosphor-ipmi-flash-bmc-prepare.target',
+ 'phosphor-ipmi-flash-bmc-verify.target',
+ 'phosphor-ipmi-flash-bmc-update.target',
]
if get_option('host-bios')
- systemd_data += [
- 'phosphor-ipmi-flash-bios-prepare.target',
- 'phosphor-ipmi-flash-bios-verify.target',
- 'phosphor-ipmi-flash-bios-update.target']
+ systemd_data += [
+ 'phosphor-ipmi-flash-bios-prepare.target',
+ 'phosphor-ipmi-flash-bios-verify.target',
+ 'phosphor-ipmi-flash-bios-update.target',
+ ]
endif
systemd = dependency('systemd')
if systemd.found()
- foreach data : systemd_data
- configure_file(
- input: data + '.in',
- output: data,
- configuration: conf_data,
- install: true,
- install_dir: systemd.get_variable('systemdsystemunitdir'))
- endforeach
+ foreach data : systemd_data
+ configure_file(
+ input: data + '.in',
+ output: data,
+ configuration: conf_data,
+ install: true,
+ install_dir: systemd.get_variable('systemdsystemunitdir'),
+ )
+ endforeach
endif
firmware_source = [
- 'firmware_handlers_builder.cpp',
- 'firmware_handler.cpp',
- 'lpc_handler.cpp']
+ 'firmware_handlers_builder.cpp',
+ 'firmware_handler.cpp',
+ 'lpc_handler.cpp',
+]
if (get_option('lpc-type') == 'aspeed-lpc' or
- get_option('tests').allowed())
- firmware_source += 'lpc_aspeed.cpp'
+get_option('tests').allowed())
+ firmware_source += 'lpc_aspeed.cpp'
endif
if (get_option('lpc-type') == 'nuvoton-lpc' or
- get_option('tests').allowed())
- firmware_source += 'lpc_nuvoton.cpp'
+get_option('tests').allowed())
+ firmware_source += 'lpc_nuvoton.cpp'
endif
if (get_option('p2a-type') == 'aspeed-p2a' or
- get_option('tests').allowed())
- firmware_source += 'pci_handler.cpp'
+get_option('tests').allowed())
+ firmware_source += 'pci_handler.cpp'
endif
if get_option('p2a-type') == 'nuvoton-p2a-vga'
- firmware_source += 'pci_nuvoton_handler.cpp'
+ firmware_source += 'pci_nuvoton_handler.cpp'
endif
if get_option('p2a-type') == 'nuvoton-p2a-mbox'
- firmware_source += 'pci_nuvoton_handler.cpp'
+ firmware_source += 'pci_nuvoton_handler.cpp'
endif
if get_option('net-bridge')
- firmware_source += 'net_handler.cpp'
+ firmware_source += 'net_handler.cpp'
endif
firmware_pre = declare_dependency(
- include_directories: [root_inc, bmc_inc, firmware_inc],
- dependencies: [
- dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']),
- common_dep,
- blobs_dep,
- sys_dep,
- ])
+ include_directories: [root_inc, bmc_inc, firmware_inc],
+ dependencies: [
+ dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']),
+ common_dep,
+ blobs_dep,
+ sys_dep,
+ ],
+)
firmware_lib = static_library(
- 'firmwareblob',
- firmware_source,
- conf_h,
- implicit_include_directories: false,
- dependencies: firmware_pre)
+ 'firmwareblob',
+ firmware_source,
+ conf_h,
+ implicit_include_directories: false,
+ dependencies: firmware_pre,
+)
firmware_dep = declare_dependency(
- link_with: firmware_lib,
- dependencies: firmware_pre)
+ link_with: firmware_lib,
+ dependencies: firmware_pre,
+)
shared_module(
- 'firmwareblob',
- 'main.cpp',
- implicit_include_directories: false,
- dependencies: [
- firmware_dep,
- dependency('libipmid'),
- ],
- install: true,
- install_dir: get_option('libdir') / 'blob-ipmid')
+ 'firmwareblob',
+ 'main.cpp',
+ implicit_include_directories: false,
+ dependencies: [firmware_dep, dependency('libipmid')],
+ install: true,
+ install_dir: get_option('libdir') / 'blob-ipmid',
+)
if get_option('tests').allowed()
- subdir('test')
+ subdir('test')
endif
diff --git a/bmc/firmware-handler/test/meson.build b/bmc/firmware-handler/test/meson.build
index 4ea436e..846ee2a 100644
--- a/bmc/firmware-handler/test/meson.build
+++ b/bmc/firmware-handler/test/meson.build
@@ -1,43 +1,53 @@
firmware_tests = [
- 'handler',
- 'stat',
- 'canhandle',
- 'write',
- 'writemeta',
- 'open',
- 'close',
- 'sessionstat',
- 'commit',
- 'state_notyetstarted',
- 'state_uploadinprogress',
- 'state_verificationpending',
- 'state_verificationstarted',
- 'state_verificationcompleted',
- 'state_updatepending',
- 'state_updatestarted',
- 'state_updatecompleted',
- 'state_notyetstarted_tarball',
- 'multiplebundle',
- 'json',
- 'skip']
+ 'handler',
+ 'stat',
+ 'canhandle',
+ 'write',
+ 'writemeta',
+ 'open',
+ 'close',
+ 'sessionstat',
+ 'commit',
+ 'state_notyetstarted',
+ 'state_uploadinprogress',
+ 'state_verificationpending',
+ 'state_verificationstarted',
+ 'state_verificationcompleted',
+ 'state_updatepending',
+ 'state_updatestarted',
+ 'state_updatecompleted',
+ 'state_notyetstarted_tarball',
+ 'multiplebundle',
+ 'json',
+ 'skip',
+]
foreach t : firmware_tests
- test(
- t,
- executable(
- t.underscorify(), 'firmware_' + t + '_unittest.cpp',
- build_by_default: false,
- implicit_include_directories: false,
- include_directories: [root_inc, bmc_test_inc, firmware_inc],
- dependencies:
- [firmware_dep, image_mock_dep, triggerable_mock_dep, gtest, gmock]))
+ test(
+ t,
+ executable(
+ t.underscorify(),
+ 'firmware_' + t + '_unittest.cpp',
+ build_by_default: false,
+ implicit_include_directories: false,
+ include_directories: [root_inc, bmc_test_inc, firmware_inc],
+ dependencies: [
+ firmware_dep,
+ image_mock_dep,
+ triggerable_mock_dep,
+ gtest,
+ gmock,
+ ],
+ ),
+ )
endforeach
file_handler_test = executable(
- 'file_handler',
- 'file_handler_unittest.cpp',
- build_by_default: false,
- implicit_include_directories: false,
- include_directories: [root_inc, bmc_inc, bmc_test_inc, firmware_inc],
- dependencies: [common_dep, blobs_dep, gtest, gmock])
+ 'file_handler',
+ 'file_handler_unittest.cpp',
+ build_by_default: false,
+ implicit_include_directories: false,
+ include_directories: [root_inc, bmc_inc, bmc_test_inc, firmware_inc],
+ dependencies: [common_dep, blobs_dep, gtest, gmock],
+)
test('file_handler', file_handler_test)
diff --git a/bmc/log-handler/meson.build b/bmc/log-handler/meson.build
index 5fad0cf..6230826 100644
--- a/bmc/log-handler/meson.build
+++ b/bmc/log-handler/meson.build
@@ -1,35 +1,30 @@
log_inc = include_directories('.')
log_pre = declare_dependency(
- include_directories: [root_inc, log_inc],
- dependencies : [
- common_dep,
- firmware_dep,
- ])
+ include_directories: [root_inc, log_inc],
+ dependencies: [common_dep, firmware_dep],
+)
log_lib = static_library(
- 'logblob',
- 'log_handler.cpp',
- 'log_handlers_builder.cpp',
- implicit_include_directories: false,
- dependencies: log_pre)
+ 'logblob',
+ 'log_handler.cpp',
+ 'log_handlers_builder.cpp',
+ implicit_include_directories: false,
+ dependencies: log_pre,
+)
-log_dep = declare_dependency(
- link_with: log_lib,
- dependencies: common_pre)
+log_dep = declare_dependency(link_with: log_lib, dependencies: common_pre)
shared_module(
- 'logblob',
- 'main.cpp',
- implicit_include_directories: false,
- dependencies: [
- log_dep,
- dependency('libipmid'),
- ],
- install: true,
- install_dir: get_option('libdir') / 'blob-ipmid')
+ 'logblob',
+ 'main.cpp',
+ implicit_include_directories: false,
+ dependencies: [log_dep, dependency('libipmid')],
+ install: true,
+ install_dir: get_option('libdir') / 'blob-ipmid',
+)
if get_option('tests').allowed()
- subdir('test')
-endif
\ No newline at end of file
+ subdir('test')
+endif
diff --git a/bmc/log-handler/test/meson.build b/bmc/log-handler/test/meson.build
index 36b4917..475f798 100644
--- a/bmc/log-handler/test/meson.build
+++ b/bmc/log-handler/test/meson.build
@@ -1,14 +1,15 @@
-log_tests = [
- 'canhandle_enumerate',
- 'createhandler']
+log_tests = ['canhandle_enumerate', 'createhandler']
foreach t : log_tests
- test(
- t,
- executable(
- t.underscorify(), 'log_' + t + '_unittest.cpp',
- build_by_default: false,
- implicit_include_directories: false,
- include_directories: [root_inc, bmc_test_inc, log_inc],
- dependencies: [log_dep, blobs_dep, gtest, gmock]))
+ test(
+ t,
+ executable(
+ t.underscorify(),
+ 'log_' + t + '_unittest.cpp',
+ build_by_default: false,
+ implicit_include_directories: false,
+ include_directories: [root_inc, bmc_test_inc, log_inc],
+ dependencies: [log_dep, blobs_dep, gtest, gmock],
+ ),
+ )
endforeach
diff --git a/bmc/meson.build b/bmc/meson.build
index 7a5ebad..05ca743 100644
--- a/bmc/meson.build
+++ b/bmc/meson.build
@@ -1,25 +1,25 @@
bmc_inc = include_directories('.')
common_pre = declare_dependency(
- dependencies: [nlohmann_json_dep],
- include_directories: [root_inc, bmc_inc])
+ dependencies: [nlohmann_json_dep],
+ include_directories: [root_inc, bmc_inc],
+)
common_lib = static_library(
- 'common',
- 'buildjson.cpp',
- 'file_handler.cpp',
- 'fs.cpp',
- 'general_systemd.cpp',
- 'skip_action.cpp',
- implicit_include_directories: false,
- dependencies: common_pre)
+ 'common',
+ 'buildjson.cpp',
+ 'file_handler.cpp',
+ 'fs.cpp',
+ 'general_systemd.cpp',
+ 'skip_action.cpp',
+ implicit_include_directories: false,
+ dependencies: common_pre,
+)
-common_dep = declare_dependency(
- link_with: common_lib,
- dependencies: common_pre)
+common_dep = declare_dependency(link_with: common_lib, dependencies: common_pre)
if get_option('tests').allowed()
- subdir('test')
+ subdir('test')
endif
subdir('firmware-handler')
diff --git a/bmc/test/meson.build b/bmc/test/meson.build
index 61d4767..48e9cff 100644
--- a/bmc/test/meson.build
+++ b/bmc/test/meson.build
@@ -1,28 +1,30 @@
bmc_test_inc = include_directories('.')
-image_mock_pre = declare_dependency(
- include_directories: [root_inc, bmc_inc])
+image_mock_pre = declare_dependency(include_directories: [root_inc, bmc_inc])
image_mock_lib = static_library(
- 'image_mock',
- 'image_mock.cpp',
- implicit_include_directories: false,
- dependencies: image_mock_pre)
+ 'image_mock',
+ 'image_mock.cpp',
+ implicit_include_directories: false,
+ dependencies: image_mock_pre,
+)
image_mock_dep = declare_dependency(
- link_with: image_mock_lib,
- dependencies: image_mock_pre)
+ link_with: image_mock_lib,
+ dependencies: image_mock_pre,
+)
-triggerable_mock_pre = declare_dependency(
- include_directories: [root_inc])
+triggerable_mock_pre = declare_dependency(include_directories: [root_inc])
triggerable_mock_lib = static_library(
- 'triggerable_mock',
- 'triggerable_mock.cpp',
- implicit_include_directories: false,
- dependencies: triggerable_mock_pre)
+ 'triggerable_mock',
+ 'triggerable_mock.cpp',
+ implicit_include_directories: false,
+ dependencies: triggerable_mock_pre,
+)
triggerable_mock_dep = declare_dependency(
- link_with: triggerable_mock_lib,
- dependencies: triggerable_mock_pre)
+ link_with: triggerable_mock_lib,
+ dependencies: triggerable_mock_pre,
+)
diff --git a/bmc/version-handler/meson.build b/bmc/version-handler/meson.build
index 6059dd4..867812c 100644
--- a/bmc/version-handler/meson.build
+++ b/bmc/version-handler/meson.build
@@ -1,35 +1,33 @@
version_inc = include_directories('.')
version_pre = declare_dependency(
- include_directories: [root_inc, version_inc],
- dependencies : [
- common_dep,
- firmware_dep,
- ])
+ include_directories: [root_inc, version_inc],
+ dependencies: [common_dep, firmware_dep],
+)
version_lib = static_library(
- 'versionblob',
- 'version_handler.cpp',
- 'version_handlers_builder.cpp',
- implicit_include_directories: false,
- dependencies: version_pre)
+ 'versionblob',
+ 'version_handler.cpp',
+ 'version_handlers_builder.cpp',
+ implicit_include_directories: false,
+ dependencies: version_pre,
+)
version_dep = declare_dependency(
- link_with: version_lib,
- dependencies: common_pre)
+ link_with: version_lib,
+ dependencies: common_pre,
+)
shared_module(
- 'versionblob',
- 'main.cpp',
- implicit_include_directories: false,
- dependencies: [
- version_dep,
- dependency('libipmid'),
- ],
- install: true,
- install_dir: get_option('libdir') / 'blob-ipmid')
+ 'versionblob',
+ 'main.cpp',
+ implicit_include_directories: false,
+ dependencies: [version_dep, dependency('libipmid')],
+ install: true,
+ install_dir: get_option('libdir') / 'blob-ipmid',
+)
if get_option('tests').allowed()
- subdir('test')
-endif
\ No newline at end of file
+ subdir('test')
+endif
diff --git a/bmc/version-handler/test/meson.build b/bmc/version-handler/test/meson.build
index 4c12464..d371591 100644
--- a/bmc/version-handler/test/meson.build
+++ b/bmc/version-handler/test/meson.build
@@ -1,19 +1,23 @@
version_tests = [
- 'json',
- 'canhandle_enumerate',
- 'createhandler',
- 'open',
- 'close',
- 'read',
- 'stat']
+ 'json',
+ 'canhandle_enumerate',
+ 'createhandler',
+ 'open',
+ 'close',
+ 'read',
+ 'stat',
+]
foreach t : version_tests
- test(
- t,
- executable(
- t.underscorify(), 'version_' + t + '_unittest.cpp',
- build_by_default: false,
- implicit_include_directories: false,
- include_directories: [root_inc, bmc_test_inc, version_inc],
- dependencies: [version_dep, blobs_dep, gtest, gmock]))
+ test(
+ t,
+ executable(
+ t.underscorify(),
+ 'version_' + t + '_unittest.cpp',
+ build_by_default: false,
+ implicit_include_directories: false,
+ include_directories: [root_inc, bmc_test_inc, version_inc],
+ dependencies: [version_dep, blobs_dep, gtest, gmock],
+ ),
+ )
endforeach
diff --git a/cleanup/meson.build b/cleanup/meson.build
index 0e8f031..6af1b7e 100644
--- a/cleanup/meson.build
+++ b/cleanup/meson.build
@@ -1,30 +1,31 @@
cleanup_pre = declare_dependency(
- include_directories: [root_inc, include_directories('.')],
- dependencies: blobs_dep)
+ include_directories: [root_inc, include_directories('.')],
+ dependencies: blobs_dep,
+)
cleanup_lib = static_library(
- 'firmwarecleanupblob',
- 'cleanup.cpp',
- 'fs.cpp',
- conf_h,
- implicit_include_directories: false,
- dependencies: cleanup_pre)
+ 'firmwarecleanupblob',
+ 'cleanup.cpp',
+ 'fs.cpp',
+ conf_h,
+ implicit_include_directories: false,
+ dependencies: cleanup_pre,
+)
cleanup_dep = declare_dependency(
- link_with: cleanup_lib,
- dependencies: cleanup_pre)
+ link_with: cleanup_lib,
+ dependencies: cleanup_pre,
+)
shared_module(
- 'firmwarecleanupblob',
- 'main.cpp',
- implicit_include_directories: false,
- dependencies: [
- cleanup_dep,
- dependency('libipmid'),
- ],
- install: true,
- install_dir: get_option('libdir') / 'blob-ipmid')
+ 'firmwarecleanupblob',
+ 'main.cpp',
+ implicit_include_directories: false,
+ dependencies: [cleanup_dep, dependency('libipmid')],
+ install: true,
+ install_dir: get_option('libdir') / 'blob-ipmid',
+)
if get_option('tests').allowed()
- subdir('test')
+ subdir('test')
endif
diff --git a/cleanup/test/meson.build b/cleanup/test/meson.build
index 3a7111d..94fd769 100644
--- a/cleanup/test/meson.build
+++ b/cleanup/test/meson.build
@@ -1,8 +1,9 @@
cleanup_test = executable(
- 'cleanup',
- 'cleanup_handler_unittest.cpp',
- build_by_default: false,
- implicit_include_directories: false,
- include_directories: root_inc,
- dependencies: [cleanup_dep, gtest, gmock])
+ 'cleanup',
+ 'cleanup_handler_unittest.cpp',
+ build_by_default: false,
+ implicit_include_directories: false,
+ include_directories: root_inc,
+ dependencies: [cleanup_dep, gtest, gmock],
+)
test('cleanup', cleanup_test)
diff --git a/meson.build b/meson.build
index 0cc7021..72cc7b7 100644
--- a/meson.build
+++ b/meson.build
@@ -1,164 +1,187 @@
project(
- 'phosphor-ipmi-flash',
- 'cpp',
- version: '0.1',
- meson_version: '>=1.1.1',
- default_options: [
- 'cpp_std=c++23',
- 'warning_level=3',
- 'werror=true',
- ])
+ 'phosphor-ipmi-flash',
+ 'cpp',
+ version: '0.1',
+ meson_version: '>=1.1.1',
+ default_options: ['cpp_std=c++23', 'warning_level=3', 'werror=true'],
+)
root_inc = include_directories('.')
# Setting up config data
conf_data = configuration_data()
-conf_data.set_quoted('STATIC_HANDLER_STAGED_NAME', get_option('static-handler-staged-name'))
-conf_data.set_quoted('PREPARATION_DBUS_SERVICE', get_option('preparation-dbus-service'))
+conf_data.set_quoted(
+ 'STATIC_HANDLER_STAGED_NAME',
+ get_option('static-handler-staged-name'),
+)
+conf_data.set_quoted(
+ 'PREPARATION_DBUS_SERVICE',
+ get_option('preparation-dbus-service'),
+)
conf_data.set_quoted('VERIFY_DBUS_SERVICE', get_option('verify-dbus-service'))
conf_data.set_quoted('UPDATE_DBUS_SERVICE', get_option('update-dbus-service'))
conf_data.set_quoted('BIOS_STAGED_NAME', get_option('bios-staged-name'))
-conf_data.set_quoted('PREPARATION_BIOS_TARGET', get_option('preparation-bios-target'))
+conf_data.set_quoted(
+ 'PREPARATION_BIOS_TARGET',
+ get_option('preparation-bios-target'),
+)
conf_data.set_quoted('VERIFY_BIOS_TARGET', get_option('verify-bios-target'))
conf_data.set_quoted('UPDATE_BIOS_TARGET', get_option('update-bios-target'))
conf_data.set_quoted('TARBALL_STAGED_NAME', get_option('tarball-staged-name'))
conf_data.set_quoted('HASH_FILENAME', get_option('hash-filename'))
-conf_data.set_quoted('VERIFY_STATUS_FILENAME', get_option('verify-status-filename'))
-conf_data.set_quoted('UPDATE_STATUS_FILENAME', get_option('update-status-filename'))
-conf_data.set_quoted('BIOS_VERIFY_STATUS_FILENAME', get_option('bios-verify-status-filename'))
+conf_data.set_quoted(
+ 'VERIFY_STATUS_FILENAME',
+ get_option('verify-status-filename'),
+)
+conf_data.set_quoted(
+ 'UPDATE_STATUS_FILENAME',
+ get_option('update-status-filename'),
+)
+conf_data.set_quoted(
+ 'BIOS_VERIFY_STATUS_FILENAME',
+ get_option('bios-verify-status-filename'),
+)
conf_data.set('MAPPED_ADDRESS', get_option('mapped-address'))
conf_data.set('NUVOTON_PCI_DID', get_option('nuvoton-pci-did'))
-conf_h = configure_file(
- output: 'config.h',
- configuration: conf_data)
+conf_h = configure_file(output: 'config.h', configuration: conf_data)
# Setup for the test config
if get_option('tests').allowed()
- add_project_arguments('-DENABLE_STATIC_LAYOUT', language: 'cpp')
- add_project_arguments('-DENABLE_TARBALL_UBI', language: 'cpp')
- add_project_arguments('-DASPEED_P2A', language: 'cpp')
- add_project_arguments('-DENABLE_PCI_BRIDGE', language: 'cpp')
- add_project_arguments('-DASPEED_LPC', language: 'cpp')
- add_project_arguments('-DNUVOTON_LPC', language: 'cpp')
- add_project_arguments('-DENABLE_LPC_BRIDGE', language: 'cpp')
- add_project_arguments('-DENABLE_HOST_BIOS', language: 'cpp')
+ add_project_arguments('-DENABLE_STATIC_LAYOUT', language: 'cpp')
+ add_project_arguments('-DENABLE_TARBALL_UBI', language: 'cpp')
+ add_project_arguments('-DASPEED_P2A', language: 'cpp')
+ add_project_arguments('-DENABLE_PCI_BRIDGE', language: 'cpp')
+ add_project_arguments('-DASPEED_LPC', language: 'cpp')
+ add_project_arguments('-DNUVOTON_LPC', language: 'cpp')
+ add_project_arguments('-DENABLE_LPC_BRIDGE', language: 'cpp')
+ add_project_arguments('-DENABLE_HOST_BIOS', language: 'cpp')
endif
if get_option('lpc-type') != 'none'
- add_project_arguments('-DENABLE_LPC_BRIDGE', language: 'cpp')
+ add_project_arguments('-DENABLE_LPC_BRIDGE', language: 'cpp')
endif
# Enable LPC and PCI for tests only.
assert(
- get_option('tests').allowed() \
+ get_option('tests').allowed() \
or get_option('lpc-type') == 'none' \
or get_option('p2a-type') == 'none',
- 'Invalid configuration enabling both PCI and LPC.')
+ 'Invalid configuration enabling both PCI and LPC.',
+)
if get_option('p2a-type') != 'none'
- add_project_arguments('-DENABLE_PCI_BRIDGE', language: 'cpp')
+ add_project_arguments('-DENABLE_PCI_BRIDGE', language: 'cpp')
endif
feature_map = {
- 'host-bios' : '-DENABLE_HOST_BIOS',
- 'ppc' : '-DENABLE_PPC',
- 'reboot-update' : '-DENABLE_REBOOT_UPDATE',
- 'update-status' : '-DENABLE_UPDATE_STATUS',
- 'net-bridge' : '-DENABLE_NET_BRIDGE',
+ 'host-bios' : '-DENABLE_HOST_BIOS',
+ 'ppc' : '-DENABLE_PPC',
+ 'reboot-update' : '-DENABLE_REBOOT_UPDATE',
+ 'update-status' : '-DENABLE_UPDATE_STATUS',
+ 'net-bridge' : '-DENABLE_NET_BRIDGE',
}
# Get the options status and build a project summary to show which flags are
# being enabled during the configuration time.
foreach option_key, option_value : feature_map
- if get_option(option_key)
- add_project_arguments(option_value, language: 'cpp')
- summary(option_key, option_value, section : 'Enabled Features')
- endif
+ if get_option(option_key)
+ add_project_arguments(option_value, language: 'cpp')
+ summary(option_key, option_value, section: 'Enabled Features')
+ endif
endforeach
update_type_combo_map = {
- 'static-layout' : '-DENABLE_STATIC_LAYOUT',
- 'tarball-ubi' : '-DENABLE_TARBALL_UBI',
+ 'static-layout' : '-DENABLE_STATIC_LAYOUT',
+ 'tarball-ubi' : '-DENABLE_TARBALL_UBI',
}
foreach option_key, option_value : update_type_combo_map
- if get_option('update-type') == option_key
- add_project_arguments(option_value, language: 'cpp')
- summary(option_key, option_value, section : 'Enabled Firmware Update Features')
- endif
+ if get_option('update-type') == option_key
+ add_project_arguments(option_value, language: 'cpp')
+ summary(
+ option_key,
+ option_value,
+ section: 'Enabled Firmware Update Features',
+ )
+ endif
endforeach
lpc_type_combo_map = {
- 'aspeed-lpc' : '-DASPEED_LPC',
- 'nuvoton-lpc' : '-DNUVOTON_LPC',
+ 'aspeed-lpc' : '-DASPEED_LPC',
+ 'nuvoton-lpc' : '-DNUVOTON_LPC',
}
foreach option_key, option_value : lpc_type_combo_map
- if get_option('lpc-type') == option_key
- add_project_arguments(option_value, language: 'cpp')
- summary(option_key, option_value, section : 'Enabled LPC Features')
- endif
+ if get_option('lpc-type') == option_key
+ add_project_arguments(option_value, language: 'cpp')
+ summary(option_key, option_value, section: 'Enabled LPC Features')
+ endif
endforeach
pci_type_combo_map = {
- 'aspeed-p2a' : '-DASPEED_P2A',
- 'nuvoton-p2a-vga' : '-DNUVOTON_P2A_VGA',
- 'nuvoton-p2a-mbox' : '-DNUVOTON_P2A_MBOX',
+ 'aspeed-p2a' : '-DASPEED_P2A',
+ 'nuvoton-p2a-vga' : '-DNUVOTON_P2A_VGA',
+ 'nuvoton-p2a-mbox' : '-DNUVOTON_P2A_MBOX',
}
foreach option_key, option_value : pci_type_combo_map
- if get_option('p2a-type') == option_key
- add_project_arguments(option_value, language: 'cpp')
- summary(option_key, option_value, section : 'Enabled PCI Features')
- endif
+ if get_option('p2a-type') == option_key
+ add_project_arguments(option_value, language: 'cpp')
+ summary(option_key, option_value, section: 'Enabled PCI Features')
+ endif
endforeach
sys_lib = static_library(
- 'sys',
- 'internal/sys.cpp',
- implicit_include_directories: false)
+ 'sys',
+ 'internal/sys.cpp',
+ implicit_include_directories: false,
+)
-sys_dep = declare_dependency(
- link_with: sys_lib)
+sys_dep = declare_dependency(link_with: sys_lib)
blobs_dep = dependency('phosphor-ipmi-blobs')
nlohmann_json_dep = dependency('nlohmann_json', include_type: 'system')
if get_option('tests').allowed()
- gtest = dependency('gtest', main: true, disabler: true, required: false)
- gmock = dependency('gmock', disabler: true, required: false)
- if not gtest.found() or not gmock.found()
- gtest_opt = import('cmake').subproject_options()
- gtest_opt.append_compile_args('c++', ['-DCMAKE_CXX_FLAGS=-Wno-pedantic'])
- gtest_proj = cmake.subproject('googletest', options: gtest_opt, required: false)
+ gtest = dependency('gtest', main: true, disabler: true, required: false)
+ gmock = dependency('gmock', disabler: true, required: false)
+ if not gtest.found() or not gmock.found()
+ gtest_opt = import('cmake').subproject_options()
+ gtest_opt.append_compile_args('c++', ['-DCMAKE_CXX_FLAGS=-Wno-pedantic'])
+ gtest_proj = cmake.subproject(
+ 'googletest',
+ options: gtest_opt,
+ required: false,
+ )
- if gtest_proj.found()
- gtest = declare_dependency(
- dependencies: [
- dependency('threads'),
- gtest_proj.dependency('gtest'),
- gtest_proj.dependency('gtest_main'),
- ])
- gmock = gtest_proj.dependency('gmock')
+ if gtest_proj.found()
+ gtest = declare_dependency(
+ dependencies: [
+ dependency('threads'),
+ gtest_proj.dependency('gtest'),
+ gtest_proj.dependency('gtest_main'),
+ ],
+ )
+ gmock = gtest_proj.dependency('gmock')
+ endif
endif
- endif
endif
if get_option('bmc-blob-handler').allowed()
- subdir('bmc')
+ subdir('bmc')
endif
if get_option('host-tool').allowed()
- subdir('tools')
+ subdir('tools')
endif
if get_option('cleanup-delete').allowed()
- subdir('cleanup')
+ subdir('cleanup')
endif
diff --git a/meson.options b/meson.options
index f1dd4f8..52c5755 100644
--- a/meson.options
+++ b/meson.options
@@ -1,25 +1,78 @@
option('tests', type: 'feature', description: 'Build tests')
# Build Options
-option('bmc-blob-handler', type: 'feature', description: 'Build the BMC BLOB handler')
-option('cleanup-delete', type: 'feature', description: 'Enable use of the delete files cleanup mechanism')
+option(
+ 'bmc-blob-handler',
+ type: 'feature',
+ description: 'Build the BMC BLOB handler',
+)
+option(
+ 'cleanup-delete',
+ type: 'feature',
+ description: 'Enable use of the delete files cleanup mechanism',
+)
option('host-tool', type: 'feature', description: 'Build the host tool')
# BMC Blob Handler Options
-option('host-bios', type: 'boolean', value: false, description: 'Install default BIOS update configs')
-option('reboot-update', type: 'boolean', value: false, description: 'Enable use of reboot update mechanism')
-option('update-status', type: 'boolean', value: false, description: 'Enable use of update status file')
+option(
+ 'host-bios',
+ type: 'boolean',
+ value: false,
+ description: 'Install default BIOS update configs',
+)
+option(
+ 'reboot-update',
+ type: 'boolean',
+ value: false,
+ description: 'Enable use of reboot update mechanism',
+)
+option(
+ 'update-status',
+ type: 'boolean',
+ value: false,
+ description: 'Enable use of update status file',
+)
-option('update-type', type : 'combo', choices : ['none', 'static-layout', 'tarball-ubi'], description: 'Enable firmware update via Blobs')
+option(
+ 'update-type',
+ type: 'combo',
+ choices: ['none', 'static-layout', 'tarball-ubi'],
+ description: 'Enable firmware update via Blobs',
+)
-option('lpc-type', type : 'combo', choices : ['none', 'aspeed-lpc', 'nuvoton-lpc'], description: 'Enable external transfers using Aspeed/Nuvoton LPC')
-option('p2a-type', type : 'combo', choices : ['none', 'aspeed-p2a', 'nuvoton-p2a-vga', 'nuvoton-p2a-mbox'], description: 'Enable external transfers using Aspeed PCI-to-AHB, Nuvoton PCI-to-AHB via VGA, or Nuvoton PCI-to-AHB via MBOX')
-option('net-bridge', type: 'boolean', value: false, description: 'Enable external transfers using a TCP connection')
+option(
+ 'lpc-type',
+ type: 'combo',
+ choices: ['none', 'aspeed-lpc', 'nuvoton-lpc'],
+ description: 'Enable external transfers using Aspeed/Nuvoton LPC',
+)
+option(
+ 'p2a-type',
+ type: 'combo',
+ choices: ['none', 'aspeed-p2a', 'nuvoton-p2a-vga', 'nuvoton-p2a-mbox'],
+ description: 'Enable external transfers using Aspeed PCI-to-AHB, Nuvoton PCI-to-AHB via VGA, or Nuvoton PCI-to-AHB via MBOX',
+)
+option(
+ 'net-bridge',
+ type: 'boolean',
+ value: false,
+ description: 'Enable external transfers using a TCP connection',
+)
# Host Tool Options
-option('ppc', type: 'boolean', value: false, description: 'Enable ppc host memory access')
+option(
+ 'ppc',
+ type: 'boolean',
+ value: false,
+ description: 'Enable ppc host memory access',
+)
# Default value 1872 is 0x0750 below
-option('nuvoton-pci-did', type : 'integer', value : 1872, description : 'The device-id for Nuvoton PCI bridge')
+option(
+ 'nuvoton-pci-did',
+ type: 'integer',
+ value: 1872,
+ description: 'The device-id for Nuvoton PCI bridge',
+)
# Configuration Details
@@ -27,19 +80,89 @@
# e.g. https://github.com/openbmc/linux/blob/1da2ce51886a3b2f5db2087f26c661e13ee13b84/arch/arm/boot/dts/aspeed-bmc-quanta-q71l.dts#L26
# or https://github.com/openbmc/linux/blob/1da2ce51886a3b2f5db2087f26c661e13ee13b84/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts#L166
# for PCI, this address is passed back to the host and is used directly.
-option('mapped-address', type : 'string', value : '0', description : 'Value for memory region mapping')
+option(
+ 'mapped-address',
+ type: 'string',
+ value: '0',
+ description: 'Value for memory region mapping',
+)
-option('static-handler-staged-name', type : 'string', value : '/run/initramfs/bmc-image', description : 'The file to use for staging the firmware update')
-option('tarball-staged-name', type : 'string', value : '/tmp/image-update.tar', description : 'The file to use for staging the firmware update')
-option('hash-filename', type : 'string', value : '/tmp/bmc.sig', description : 'The file to use for the hash provided')
-option('verify-status-filename', type : 'string', value : '/tmp/bmc.verify', description : 'The file checked for the verification status.')
-option('update-status-filename', type : 'string', value : '/tmp/bmc.update', description : 'The file checked for the update status')
-option('bios-verify-status-filename', type : 'string', value : '/tmp/bios.verify', description : 'The file checked for the verification status')
+option(
+ 'static-handler-staged-name',
+ type: 'string',
+ value: '/run/initramfs/bmc-image',
+ description: 'The file to use for staging the firmware update',
+)
+option(
+ 'tarball-staged-name',
+ type: 'string',
+ value: '/tmp/image-update.tar',
+ description: 'The file to use for staging the firmware update',
+)
+option(
+ 'hash-filename',
+ type: 'string',
+ value: '/tmp/bmc.sig',
+ description: 'The file to use for the hash provided',
+)
+option(
+ 'verify-status-filename',
+ type: 'string',
+ value: '/tmp/bmc.verify',
+ description: 'The file checked for the verification status.',
+)
+option(
+ 'update-status-filename',
+ type: 'string',
+ value: '/tmp/bmc.update',
+ description: 'The file checked for the update status',
+)
+option(
+ 'bios-verify-status-filename',
+ type: 'string',
+ value: '/tmp/bios.verify',
+ description: 'The file checked for the verification status',
+)
-option('preparation-dbus-service', type : 'string', value : 'phosphor-ipmi-flash-bmc-prepare.target', description : 'The systemd target started when the host starts to send an update')
-option('verify-dbus-service', type : 'string', value : 'phosphor-ipmi-flash-bmc-verify.target', description : 'The systemd target started for verification')
-option('update-dbus-service', type : 'string', value : 'phosphor-ipmi-flash-bmc-update.target', description : 'The systemd target started for updating the BMC')
-option('bios-staged-name', type : 'string', value : 'bios-staged-name', description : 'The file to use for staging the bios firmware update')
-option('preparation-bios-target', type : 'string', value : 'phosphor-ipmi-flash-bios-prepare.target', description : 'The systemd target started when the host starts to send an update')
-option('verify-bios-target', type : 'string', value : 'phosphor-ipmi-flash-bios-verify.target', description : 'The systemd target started for verifying the BIOS image')
-option('update-bios-target', type : 'string', value : 'phosphor-ipmi-flash-bios-update.target', description : 'The systemd target started for updating the BIOS')
\ No newline at end of file
+option(
+ 'preparation-dbus-service',
+ type: 'string',
+ value: 'phosphor-ipmi-flash-bmc-prepare.target',
+ description: 'The systemd target started when the host starts to send an update',
+)
+option(
+ 'verify-dbus-service',
+ type: 'string',
+ value: 'phosphor-ipmi-flash-bmc-verify.target',
+ description: 'The systemd target started for verification',
+)
+option(
+ 'update-dbus-service',
+ type: 'string',
+ value: 'phosphor-ipmi-flash-bmc-update.target',
+ description: 'The systemd target started for updating the BMC',
+)
+option(
+ 'bios-staged-name',
+ type: 'string',
+ value: 'bios-staged-name',
+ description: 'The file to use for staging the bios firmware update',
+)
+option(
+ 'preparation-bios-target',
+ type: 'string',
+ value: 'phosphor-ipmi-flash-bios-prepare.target',
+ description: 'The systemd target started when the host starts to send an update',
+)
+option(
+ 'verify-bios-target',
+ type: 'string',
+ value: 'phosphor-ipmi-flash-bios-verify.target',
+ description: 'The systemd target started for verifying the BIOS image',
+)
+option(
+ 'update-bios-target',
+ type: 'string',
+ value: 'phosphor-ipmi-flash-bios-update.target',
+ description: 'The systemd target started for updating the BIOS',
+)
diff --git a/tools/meson.build b/tools/meson.build
index eda5e19..e9eccbd 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -1,43 +1,47 @@
tools_inc = include_directories('.')
updater_pre = [
- dependency('ipmiblob'),
- dependency('pciaccess', fallback: ['pciaccess', 'dep_pciaccess']),
- dependency('stdplus', fallback: ['stdplus', 'stdplus_dep']),
- blobs_dep,
- sys_dep]
+ dependency('ipmiblob'),
+ dependency('pciaccess', fallback: ['pciaccess', 'dep_pciaccess']),
+ dependency('stdplus', fallback: ['stdplus', 'stdplus_dep']),
+ blobs_dep,
+ sys_dep,
+]
updater_lib = static_library(
- 'updater_lib',
- 'updater.cpp',
- 'handler.cpp',
- 'helper.cpp',
- 'bt.cpp',
- 'lpc.cpp',
- 'io.cpp',
- 'net.cpp',
- 'pci.cpp',
- 'pciaccess.cpp',
- 'p2a.cpp',
- 'progress.cpp',
- conf_h,
- dependencies: updater_pre,
- include_directories: root_inc)
+ 'updater_lib',
+ 'updater.cpp',
+ 'handler.cpp',
+ 'helper.cpp',
+ 'bt.cpp',
+ 'lpc.cpp',
+ 'io.cpp',
+ 'net.cpp',
+ 'pci.cpp',
+ 'pciaccess.cpp',
+ 'p2a.cpp',
+ 'progress.cpp',
+ conf_h,
+ dependencies: updater_pre,
+ include_directories: root_inc,
+)
updater_dep = declare_dependency(
- dependencies: updater_pre,
- include_directories: root_inc,
- link_with: updater_lib)
+ dependencies: updater_pre,
+ include_directories: root_inc,
+ link_with: updater_lib,
+)
executable(
- 'burn_my_bmc',
- 'main.cpp',
- implicit_include_directories: false,
- dependencies: updater_dep,
- include_directories: root_inc,
- install: true,
- install_dir: get_option('bindir'))
+ 'burn_my_bmc',
+ 'main.cpp',
+ implicit_include_directories: false,
+ dependencies: updater_dep,
+ include_directories: root_inc,
+ install: true,
+ install_dir: get_option('bindir'),
+)
if get_option('tests').allowed()
- subdir('test')
+ subdir('test')
endif
diff --git a/tools/test/meson.build b/tools/test/meson.build
index 99aab7a..12f1aff 100644
--- a/tools/test/meson.build
+++ b/tools/test/meson.build
@@ -1,20 +1,23 @@
tool_tests = [
- 'tools_bt',
- 'tools_lpc',
- 'tools_pci',
- 'tools_net',
- 'tools_updater',
- 'tools_helper',
- 'io',
+ 'tools_bt',
+ 'tools_lpc',
+ 'tools_pci',
+ 'tools_net',
+ 'tools_updater',
+ 'tools_helper',
+ 'io',
]
foreach t : tool_tests
- test(
- t,
- executable(
- t.underscorify(), t + '_unittest.cpp',
- build_by_default: false,
- implicit_include_directories: false,
- include_directories: [root_inc, tools_inc],
- dependencies: [updater_dep, gtest, gmock]))
+ test(
+ t,
+ executable(
+ t.underscorify(),
+ t + '_unittest.cpp',
+ build_by_default: false,
+ implicit_include_directories: false,
+ include_directories: [root_inc, tools_inc],
+ dependencies: [updater_dep, gtest, gmock],
+ ),
+ )
endforeach