meson: reformat with meson formatter
Apply the `meson format` results.
Change-Id: I7a634219b8f2de45f106049e57b40b8212032abb
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/meson.build b/meson.build
index 28c0126..5f59b8a 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,6 @@
project(
- 'libmctp', 'c',
+ 'libmctp',
+ 'c',
meson_version: '>= 1.1',
version: '0.11',
default_options: [
@@ -11,44 +12,22 @@
],
)
-sources = [
- 'core.c',
- 'alloc.c',
- 'control.c',
-]
+sources = ['core.c', 'alloc.c', 'control.c']
-headers = [
- 'libmctp.h',
-]
+headers = ['libmctp.h']
-serial_sources = [
- 'serial.c',
- 'crc-16-ccitt.c',
-]
+serial_sources = ['serial.c', 'crc-16-ccitt.c']
-serial_headers = [
- 'libmctp-serial.h'
-]
+serial_headers = ['libmctp-serial.h']
-astlpc_sources = [
- 'astlpc.c',
- 'crc32.c',
-]
+astlpc_sources = ['astlpc.c', 'crc32.c']
-astlpc_headers = [
- 'libmctp-astlpc.h',
-]
+astlpc_headers = ['libmctp-astlpc.h']
-i2c_sources = [
- 'i2c.c',
-]
+i2c_sources = ['i2c.c']
-i2c_headers = [
- 'libmctp-i2c.h',
-]
-control_sources = [
- 'control.c',
-]
+i2c_headers = ['libmctp-i2c.h']
+control_sources = ['control.c']
libmctp_sources = sources
libmctp_headers = headers
@@ -72,41 +51,48 @@
compiler = meson.get_compiler('c')
if not get_option('custom_alloc') and get_option('default_alloc').require(
- compiler.links('''
+ compiler.links(
+ '''
#include <stdlib.h>
void main()
{
free(malloc(4096));
}
- ''')).allowed()
- add_project_arguments('-DMCTP_DEFAULT_ALLOC', language : 'c')
+ ''',
+ ),
+).allowed()
+ add_project_arguments('-DMCTP_DEFAULT_ALLOC', language: 'c')
endif
if get_option('custom_alloc')
- add_project_arguments('-DMCTP_CUSTOM_ALLOC', language : 'c')
+ add_project_arguments('-DMCTP_CUSTOM_ALLOC', language: 'c')
endif
if get_option('nolog')
- add_project_arguments('-DMCTP_NOLOG', language : 'c')
+ add_project_arguments('-DMCTP_NOLOG', language: 'c')
else
libmctp_sources += ['log.c']
endif
feat_fileio = get_option('fileio').require(
- compiler.links('''
+ compiler.links(
+ '''
#include <poll.h>
#include <unistd.h>
void main()
{
poll(NULL, 0, -1);
}
- '''))
+ ''',
+ ),
+)
if feat_fileio.allowed()
- add_project_arguments('-DMCTP_HAVE_FILEIO', language : 'c')
+ add_project_arguments('-DMCTP_HAVE_FILEIO', language: 'c')
endif
if get_option('syslog').require(
- compiler.links('''
+ compiler.links(
+ '''
#include <stdarg.h>
#include <syslog.h>
void check_vsyslog(int level, const char *fmt, ...)
@@ -120,12 +106,15 @@
{
check_vsyslog(0, "\n");
}
- ''')).allowed()
- add_project_arguments('-DMCTP_HAVE_SYSLOG', language : 'c')
+ ''',
+ ),
+).allowed()
+ add_project_arguments('-DMCTP_HAVE_SYSLOG', language: 'c')
endif
if get_option('stdio').require(
- compiler.links('''
+ compiler.links(
+ '''
#include <stdarg.h>
#include <stdio.h>
void check_vsyslog(const char *fmt, ...)
@@ -139,8 +128,10 @@
{
check_vsyslog("\n");
}
- ''')).allowed()
- add_project_arguments('-DMCTP_HAVE_STDIO', language : 'c')
+ ''',
+ ),
+).allowed()
+ add_project_arguments('-DMCTP_HAVE_STDIO', language: 'c')
endif
# pcap is necessary for mctp-demux-daemon to be functional
@@ -150,7 +141,8 @@
libsystemd_dep = dependency('libsystemd', required: false)
libmctp_include_dir = include_directories('.', is_system: true)
-libmctp = library('mctp',
+libmctp = library(
+ 'mctp',
libmctp_sources,
include_directories: libmctp_include_dir,
version: meson.project_version(),
@@ -164,7 +156,8 @@
install_data('systemd/system/mctp-demux.socket', install_dir: unitdir)
endif
-import('pkgconfig').generate(libmctp,
+import('pkgconfig').generate(
+ libmctp,
name: 'libmctp',
description: 'MCTP protocol implementation',
version: meson.project_version(),
@@ -177,19 +170,24 @@
# TODO: these should depend on the -internal.h headers so they rebuild
# on changes, unclear how to do that.
-sizeof_mctp = compiler.sizeof('struct mctp',
+sizeof_mctp = compiler.sizeof(
+ 'struct mctp',
include_directories: libmctp_include_dir,
- prefix: '#include "core-internal.h"')
-sizeof_binding_i2c = compiler.sizeof('struct mctp_binding_i2c',
+ prefix: '#include "core-internal.h"',
+)
+sizeof_binding_i2c = compiler.sizeof(
+ 'struct mctp_binding_i2c',
include_directories: libmctp_include_dir,
- prefix: '#include "i2c-internal.h"')
-sizes_h = configure_file(configuration: {
+ prefix: '#include "i2c-internal.h"',
+)
+sizes_h = configure_file(
+ configuration: {
'sizeof_struct_mctp': sizeof_mctp,
'sizeof_binding_i2c': sizeof_binding_i2c,
},
input: 'libmctp-sizes.h.in',
output: 'libmctp-sizes.h',
- )
+)
install_headers(sizes_h)
if feat_fileio.allowed()
diff --git a/meson.options b/meson.options
index 18b594e..ff0b0e6 100644
--- a/meson.options
+++ b/meson.options
@@ -1,9 +1,4 @@
-option(
- 'tests',
- type: 'feature',
- value: 'enabled',
- description: 'Build tests'
-)
+option('tests', type: 'feature', value: 'enabled', description: 'Build tests')
option(
'bindings',
type: 'array',
@@ -16,21 +11,13 @@
type: 'feature',
description: 'Use libc malloc and free for heap memory',
)
-option(
- 'stdio',
- type: 'feature',
- description: 'Support logging to stdio',
-)
+option('stdio', type: 'feature', description: 'Support logging to stdio')
option(
'fileio',
type: 'feature',
description: 'Support interfaces based on file-descriptors',
)
-option(
- 'syslog',
- type: 'feature',
- description: 'Support logging to syslog',
-)
+option('syslog', type: 'feature', description: 'Support logging to syslog')
option(
'custom_alloc',
type: 'boolean',
diff --git a/tests/meson.build b/tests/meson.build
index eb398b0..fd48f74 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,11 +1,5 @@
-tests = [
- 'test_eid',
- 'test_seq',
- 'test_bridge',
- 'test_cmds',
- 'test_core',
- ]
+tests = ['test_eid', 'test_seq', 'test_bridge', 'test_cmds', 'test_core']
if get_option('bindings').contains('serial')
tests += 'test_serial'
diff --git a/utils/meson.build b/utils/meson.build
index ae03af8..6c64bc3 100644
--- a/utils/meson.build
+++ b/utils/meson.build
@@ -9,7 +9,8 @@
demux_sources += 'mctp-capture.c'
endif
-demux = executable('mctp-demux-daemon',
+demux = executable(
+ 'mctp-demux-daemon',
demux_sources,
include_directories: libmctp_include_dir,
dependencies: demux_dep,
@@ -17,14 +18,16 @@
install: true,
)
-pipe = executable('mctp-pipe',
+pipe = executable(
+ 'mctp-pipe',
'mctp-pipe.c',
include_directories: libmctp_include_dir,
dependencies: [libmctp_dep],
install: false,
)
-mctp_in = executable('mctp-in',
+mctp_in = executable(
+ 'mctp-in',
'mctp-in.c',
include_directories: libmctp_include_dir,
dependencies: [libmctp_dep],