meson: Format build files with `meson format`
Additionally, add the formatting command to `scripts/pre-submit` so it's
run by OpenBMC's CI (via `scripts/run-ci`).
Change-Id: Ifb8fc06106b8cfa9155e986528b769a5ca450b4c
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/src/dsp/meson.build b/src/dsp/meson.build
index 39f4db8..b81e533 100644
--- a/src/dsp/meson.build
+++ b/src/dsp/meson.build
@@ -1,9 +1,9 @@
libpldm_sources += files(
- 'base.c',
- 'bios.c',
- 'bios_table.c',
- 'firmware_update.c',
- 'fru.c',
- 'pdr.c',
- 'platform.c',
+ 'base.c',
+ 'bios.c',
+ 'bios_table.c',
+ 'firmware_update.c',
+ 'fru.c',
+ 'pdr.c',
+ 'platform.c',
)
diff --git a/src/meson.build b/src/meson.build
index 5242eed..a4c8609 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,95 +1,105 @@
-libpldm_sources = files(
- 'responder.c',
- 'utils.c'
-)
+libpldm_sources = files('responder.c', 'utils.c')
subdir('dsp')
subdir('requester')
subdir('transport')
if get_option('oem-ibm').allowed()
- subdir('oem/ibm')
+ subdir('oem/ibm')
endif
if get_option('oem-meta').allowed()
- subdir('oem/meta')
+ subdir('oem/meta')
endif
libpldm_link_args = []
foreach alias : libpldm_deprecated_aliases
- libpldm_link_args += '-Wl,--defsym=@0@=@1@'.format(alias[0], alias[1])
+ libpldm_link_args += '-Wl,--defsym=@0@=@1@'.format(alias[0], alias[1])
endforeach
libpldm = library(
- 'pldm',
- libpldm_sources,
- implicit_include_directories: false,
- include_directories: [
- libpldm_include_dir,
- include_directories('.')
- ],
- link_args: libpldm_link_args,
- version: meson.project_version(),
- gnu_symbol_visibility: 'hidden',
- install: true
- )
+ 'pldm',
+ libpldm_sources,
+ implicit_include_directories: false,
+ include_directories: [libpldm_include_dir, include_directories('.')],
+ link_args: libpldm_link_args,
+ version: meson.project_version(),
+ gnu_symbol_visibility: 'hidden',
+ install: true,
+)
libpldm_dep = declare_dependency(
- include_directories: libpldm_include_dir,
- link_with: libpldm)
+ include_directories: libpldm_include_dir,
+ link_with: libpldm,
+)
import('pkgconfig').generate(
- name: 'libpldm',
- description: 'PLDM protocol encode/decode C lib',
- version: meson.project_version(),
- libraries: libpldm)
+ name: 'libpldm',
+ description: 'PLDM protocol encode/decode C lib',
+ version: meson.project_version(),
+ libraries: libpldm,
+)
if get_option('tests').allowed()
- c_suite = meson.get_compiler('c').get_id()
- cpp_suite = meson.get_compiler('cpp').get_id()
+ c_suite = meson.get_compiler('c').get_id()
+ cpp_suite = meson.get_compiler('cpp').get_id()
- if get_option('abi-compliance-check').allowed() and c_suite == cpp_suite and c_suite == 'gcc'
- host = host_machine.cpu_family()
- baseline_dump = meson.project_source_root() / 'abi' / host / '@0@.dump'.format(c_suite)
+ if get_option('abi-compliance-check').allowed() and c_suite == cpp_suite and c_suite == 'gcc'
+ host = host_machine.cpu_family()
+ baseline_dump = meson.project_source_root() / 'abi' / host / '@0@.dump'.format(
+ c_suite,
+ )
- abi_dumper = find_program('abi-dumper',
- native: true,
- required: get_option('abi-compliance-check'))
- abi_compliance_checker = find_program('abi-compliance-checker',
- native: true,
- required: get_option('abi-compliance-check'))
+ abi_dumper = find_program(
+ 'abi-dumper',
+ native: true,
+ required: get_option('abi-compliance-check'),
+ )
+ abi_compliance_checker = find_program(
+ 'abi-compliance-checker',
+ native: true,
+ required: get_option('abi-compliance-check'),
+ )
- test_abi_compliance = abi_dumper.found() and \
- abi_compliance_checker.found() and \
- import('fs').is_file(baseline_dump)
+ test_abi_compliance = abi_dumper.found() and\
+abi_compliance_checker.found() and\
+import('fs').is_file(baseline_dump)
- if test_abi_compliance
- current_dump = custom_target('abi-dump',
- input: libpldm,
- output: 'current.dump',
- command: [ abi_dumper,
- '-mixed-headers',
- '-include-paths',
- meson.project_source_root() / 'src',
- '-public-headers',
- meson.project_source_root() / 'include',
- '-sort',
- '@INPUT@',
- '-o',
- '@OUTPUT@',
- '-lver',
- meson.project_version()])
- abi_compliance = custom_target('abi-compliance',
- input: [baseline_dump, current_dump],
- output: 'abi-compliance',
- command: [ abi_compliance_checker,
- '-l',
- meson.project_name(),
- '-old',
- '@INPUT0@',
- '-new',
- '@INPUT1@' ],
- build_by_default: true)
+ if test_abi_compliance
+ current_dump = custom_target(
+ 'abi-dump',
+ input: libpldm,
+ output: 'current.dump',
+ command: [
+ abi_dumper,
+ '-mixed-headers',
+ '-include-paths',
+ meson.project_source_root() / 'src',
+ '-public-headers',
+ meson.project_source_root() / 'include',
+ '-sort',
+ '@INPUT@',
+ '-o',
+ '@OUTPUT@',
+ '-lver',
+ meson.project_version(),
+ ],
+ )
+ abi_compliance = custom_target(
+ 'abi-compliance',
+ input: [baseline_dump, current_dump],
+ output: 'abi-compliance',
+ command: [
+ abi_compliance_checker,
+ '-l',
+ meson.project_name(),
+ '-old',
+ '@INPUT0@',
+ '-new',
+ '@INPUT1@',
+ ],
+ build_by_default: true,
+ )
+ endif
endif
- endif
endif
diff --git a/src/oem/ibm/meson.build b/src/oem/ibm/meson.build
index 04bb24f..cc52f1e 100644
--- a/src/oem/ibm/meson.build
+++ b/src/oem/ibm/meson.build
@@ -1,5 +1 @@
-libpldm_sources += files(
- 'file_io.c',
- 'host.c',
- 'platform.c'
- )
+libpldm_sources += files('file_io.c', 'host.c', 'platform.c')
diff --git a/src/oem/meta/meson.build b/src/oem/meta/meson.build
index 6c89286..c618ac7 100644
--- a/src/oem/meta/meson.build
+++ b/src/oem/meta/meson.build
@@ -1,3 +1 @@
-libpldm_sources += files(
- 'file_io.c'
- )
+libpldm_sources += files('file_io.c')
diff --git a/src/requester/meson.build b/src/requester/meson.build
index 663b607..77945f9 100644
--- a/src/requester/meson.build
+++ b/src/requester/meson.build
@@ -1,4 +1 @@
-libpldm_sources += files(
- 'instance-id.c',
- 'pldm.c'
- )
+libpldm_sources += files('instance-id.c', 'pldm.c')
diff --git a/src/transport/meson.build b/src/transport/meson.build
index b0ef1ca..adc1300 100644
--- a/src/transport/meson.build
+++ b/src/transport/meson.build
@@ -1,7 +1,2 @@
-libpldm_sources += files(
- 'af-mctp.c',
- 'mctp-demux.c',
- 'socket.c',
- 'transport.c',
- 'test.c'
-)
+libpldm_sources += files('af-mctp.c', 'mctp-demux.c', 'socket.c', 'test.c'
+, 'transport.c')