@@ -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
1310cc = meson .get_compiler(' c' )
1411extra_flags = [
@@ -40,63 +37,66 @@ conf = configuration_data()
4037conf.set(' CANFIGGER_VERSION_MAJOR' , major_version)
4138conf.set(' CANFIGGER_VERSION_MINOR' , minor_version)
4239conf.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
4542src = (' 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
5552canfigger_dep = declare_dependency (
56- include_directories : include_directories (' .' ),
57- link_with : buildtarget
58- )
53+ include_directories : include_directories (' .' ),
54+ link_with : buildtarget,
55+ )
5956
6057if 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
7370endif
7471
7572if 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' )
0 commit comments