Skip to content

Commit 5996352

Browse files
committed
meson: configure and run formatter
Add a wrapper script to rerun it.
1 parent e6dc563 commit 5996352

4 files changed

Lines changed: 27 additions & 14 deletions

File tree

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ indent_size = 4
1313
[*.py]
1414
indent_style = space
1515
indent_size = 4
16+
17+
[meson.build]
18+
indent_size = 2
19+
20+
[meson_options.txt]
21+
indent_size = 2

meson.build

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ project(
1010
],
1111
license : 'MIT',
1212
meson_version : '>=0.55',
13-
version : '1.2.0'
13+
version : '1.2.0',
1414
)
1515
if not meson.is_subproject()
16-
meson.add_dist_script(
17-
'scripts/dist.py'
18-
)
16+
meson.add_dist_script('scripts/dist.py')
1917
endif
2018

2119
# project version
@@ -46,7 +44,7 @@ abi_version = '@0@.@1@.@2@'.format(
4644
)
4745
darwin_library_versions = [
4846
abi_version_major + 1,
49-
'@0@.@1@'.format(abi_version_major + 1, abi_version_minor)
47+
'@0@.@1@'.format(abi_version_major + 1, abi_version_minor),
5048
]
5149

5250
# ready to be pasted into source files
@@ -68,14 +66,16 @@ if host_machine.system() == 'darwin' and not cc.has_header('stdio.h')
6866
# in advance.
6967
# https://github.com/mesonbuild/meson/issues/5290
7068
# https://github.com/mesonbuild/meson/issues/8206
71-
error('Basic environment check failed. Check compiler flags; building for multiple CPU architectures is not supported.')
69+
error(
70+
'Basic environment check failed. Check compiler flags; building for multiple CPU architectures is not supported.',
71+
)
7272
endif
7373
found_uthash = cc.check_header(
7474
'utarray.h',
75-
required : false
75+
required : false,
7676
) and cc.check_header(
7777
'uthash.h',
78-
required : false
78+
required : false,
7979
)
8080
if found_uthash
8181
uthash = declare_dependency()
@@ -105,10 +105,10 @@ cfg.set_quoted(
105105
)
106106

107107
if cc.has_header('io.h')
108-
cfg.set('HAVE_IO_H', '1')
108+
cfg.set('HAVE_IO_H', '1')
109109
endif
110110
if cc.has_header('unistd.h')
111-
cfg.set('HAVE_UNISTD_H', '1')
111+
cfg.set('HAVE_UNISTD_H', '1')
112112
endif
113113

114114
configure_file(
@@ -130,9 +130,9 @@ add_project_arguments(
130130

131131
# include
132132
version_header = configure_file(
133-
input : 'include/dicom/version.h.in',
134-
output : 'version.h',
135-
configuration : version_data,
133+
input : 'include/dicom/version.h.in',
134+
output : 'version.h',
135+
configuration : version_data,
136136
)
137137

138138
install_headers(
@@ -175,7 +175,7 @@ libdicom = library(
175175
version : abi_version,
176176
darwin_versions : darwin_library_versions,
177177
include_directories : library_includes,
178-
gnu_symbol_visibility: 'hidden',
178+
gnu_symbol_visibility : 'hidden',
179179
install : true,
180180
)
181181
import('pkgconfig').generate(

meson.format

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
kwargs_force_multiline = true
2+
sort_files = true
3+
use_editor_config = true
4+
wide_colon = true

scripts/meson-format.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
exec meson format -c meson.format -i -r

0 commit comments

Comments
 (0)