Skip to content

Commit 531b996

Browse files
committed
meson fmt -eir
1 parent 8ea574b commit 531b996

2 files changed

Lines changed: 44 additions & 44 deletions

File tree

meson.build

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@ project(
22
'canfigger',
33
'c',
44
version: '0.3.1',
5-
meson_version : '>= 0.48.0',
5+
meson_version: '>= 0.48.0',
66
license: 'MIT',
7-
default_options: [
8-
'warning_level=3',
9-
'c_std=c99'
10-
]
11-
)
7+
default_options: ['warning_level=3', 'c_std=c99'],
8+
)
129

1310
cc = meson.get_compiler('c')
1411
extra_flags = [
@@ -40,63 +37,66 @@ conf = configuration_data()
4037
conf.set('CANFIGGER_VERSION_MAJOR', major_version)
4138
conf.set('CANFIGGER_VERSION_MINOR', minor_version)
4239
conf.set('CANFIGGER_VERSION_PATCH', patch_version)
43-
config_h = configure_file(output : 'canfigger_version.h', configuration : conf)
40+
config_h = configure_file(output: 'canfigger_version.h', configuration: conf)
4441

4542
src = ('canfigger.c')
46-
buildtarget = library(
47-
meson.project_name(),
48-
src,
49-
version : meson.project_version(),
50-
install: not meson.is_subproject(),
51-
)
43+
buildtarget = library(
44+
meson.project_name(),
45+
src,
46+
version: meson.project_version(),
47+
install: not meson.is_subproject(),
48+
)
5249

5350
# How to use in a superproject and other info
5451
# https://mesonbuild.com/Subprojects.html
5552
canfigger_dep = declare_dependency(
56-
include_directories : include_directories('.'),
57-
link_with : buildtarget
58-
)
53+
include_directories: include_directories('.'),
54+
link_with: buildtarget,
55+
)
5956

6057
if get_option('build_examples')
6158
examples = ['example-01', 'example-02']
62-
foreach ex : examples
63-
example = executable(
64-
ex,
65-
ex + '.c',
66-
dependencies: canfigger_dep,
67-
c_args: '-DSOURCE_DIR="@0@"'.format(meson.current_source_dir())
68-
)
69-
if get_option('build_tests')
70-
test('test_' + ex, example)
71-
endif
72-
endforeach
59+
foreach ex : examples
60+
example = executable(
61+
ex,
62+
ex + '.c',
63+
dependencies: canfigger_dep,
64+
c_args: '-DSOURCE_DIR="@0@"'.format(meson.current_source_dir()),
65+
)
66+
if get_option('build_tests')
67+
test('test_' + ex, example)
68+
endif
69+
endforeach
7370
endif
7471

7572
if not meson.is_subproject()
7673
pkg = import('pkgconfig')
7774
pkg.generate(
7875
buildtarget,
79-
description : 'Simple configuration file parser library')
76+
description: 'Simple configuration file parser library',
77+
)
8078

8179
install_headers('canfigger.h', config_h)
8280

8381
install_subdir(
84-
join_paths('docs'),
85-
install_dir : join_paths(get_option('docdir'), 'html'),
86-
strip_directory : true
82+
join_paths('docs'),
83+
install_dir: join_paths(get_option('docdir'), 'html'),
84+
strip_directory: true,
8785
)
8886

89-
install_data(files(
90-
'ChangeLog.txt',
91-
'example-01.c',
92-
'example-01.conf',
93-
'example-02.c',
94-
'example-02.conf',
95-
'LICENSE',
96-
'README.md',
97-
'ReleaseNotes.txt'
87+
install_data(
88+
files(
89+
'ChangeLog.txt',
90+
'LICENSE',
91+
'README.md',
92+
'ReleaseNotes.txt',
93+
'example-01.c',
94+
'example-01.conf',
95+
'example-02.c',
96+
'example-02.conf',
9897
),
99-
install_dir : get_option('docdir'))
98+
install_dir: get_option('docdir'),
99+
)
100100

101101
if get_option('build_tests')
102102
subdir('tests')

tests/meson.build

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ test_cases = [
1111
'parse_file',
1212
'skip_attributes',
1313
'unicode',
14-
]
14+
]
1515

1616
foreach case : test_cases
1717
exe = executable(
1818
'test_' + case,
1919
case + '.c',
20-
dependencies : [canfigger_dep],
21-
c_args: '-DSOURCE_DIR="@0@"'.format(meson.current_source_dir())
20+
dependencies: [canfigger_dep],
21+
c_args: '-DSOURCE_DIR="@0@"'.format(meson.current_source_dir()),
2222
)
2323
test(case, exe)
2424
endforeach

0 commit comments

Comments
 (0)