Skip to content

Commit c1b7c5e

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

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()
@@ -102,10 +102,10 @@ cfg.set_quoted(
102102
)
103103

104104
if cc.has_header('io.h')
105-
cfg.set('HAVE_IO_H', '1')
105+
cfg.set('HAVE_IO_H', '1')
106106
endif
107107
if cc.has_header('unistd.h')
108-
cfg.set('HAVE_UNISTD_H', '1')
108+
cfg.set('HAVE_UNISTD_H', '1')
109109
endif
110110

111111
configure_file(
@@ -127,9 +127,9 @@ add_project_arguments(
127127

128128
# include
129129
version_header = configure_file(
130-
input : 'include/dicom/version.h.in',
131-
output : 'version.h',
132-
configuration : version_data,
130+
input : 'include/dicom/version.h.in',
131+
output : 'version.h',
132+
configuration : version_data,
133133
)
134134

135135
install_headers(
@@ -172,7 +172,7 @@ libdicom = library(
172172
version : abi_version,
173173
darwin_versions : darwin_library_versions,
174174
include_directories : library_includes,
175-
gnu_symbol_visibility: 'hidden',
175+
gnu_symbol_visibility : 'hidden',
176176
install : true,
177177
)
178178
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)