Skip to content

Commit 8a3a31f

Browse files
clean up meson support
1 parent c101cfa commit 8a3a31f

File tree

6 files changed

+53
-94
lines changed

6 files changed

+53
-94
lines changed

examples/example_4/meson.build

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
###################################################################################
2-
# #
3-
# NAME: meson.build #
4-
# #
5-
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
6-
# WRITTEN BY: Michael Brockus. #
7-
# #
8-
# License: MIT #
9-
# #
10-
###################################################################################
11-
1+
#
2+
# build script written by : Michael Brockus.
3+
# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams.
4+
#
5+
# license: MIT
6+
#
127
project('example-4', 'c')
138

149
unity_dep = dependency('unity', fallback : ['unity', 'unity_dep'])

examples/example_4/src/meson.build

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
###################################################################################
2-
# #
3-
# NAME: meson.build #
4-
# #
5-
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
6-
# WRITTEN BY: Michael Brockus. #
7-
# #
8-
# License: MIT #
9-
# #
10-
###################################################################################
11-
1+
#
2+
# build script written by : Michael Brockus.
3+
# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams.
4+
#
5+
# license: MIT
6+
#
127
inc_dir = include_directories('.')
138
lib_list = {'a': ['ProductionCode.c' ], 'b': ['ProductionCode2.c']}
149

examples/example_4/test/meson.build

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
###################################################################################
2-
# #
3-
# NAME: meson.build #
4-
# #
5-
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
6-
# WRITTEN BY: Michael Brockus. #
7-
# #
8-
# License: MIT #
9-
# #
10-
###################################################################################
11-
1+
#
2+
# build script written by : Michael Brockus.
3+
# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams.
4+
#
5+
# license: MIT
6+
#
127
subdir('test_runners')
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
###################################################################################
2-
# #
3-
# NAME: meson.build #
4-
# #
5-
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
6-
# WRITTEN BY: Michael Brockus. #
7-
# #
8-
# License: MIT #
9-
# #
10-
###################################################################################
11-
12-
cases = [['TestProductionCode_Runner.c', join_paths('..' ,'TestProductionCode.c')],
13-
['TestProductionCode2_Runner.c', join_paths('..' ,'TestProductionCode2.c')]]
1+
#
2+
# build script written by : Michael Brockus.
3+
# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams.
4+
#
5+
# license: MIT
6+
#
7+
cases = [
8+
['TestProductionCode_Runner.c', join_paths('..' ,'TestProductionCode.c' )],
9+
['TestProductionCode2_Runner.c', join_paths('..' ,'TestProductionCode2.c')]
10+
]
1411

1512
test('Running: 01-test-case', executable('01-test-case', cases[0], dependencies: [ a_dep, unity_dep ]))
1613
test('Running: 02-test-case', executable('02-test-case', cases[1], dependencies: [ b_dep, unity_dep ]))

meson.build

+19-37
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,29 @@
1-
###################################################################################
2-
# #
3-
# NAME: meson.build #
4-
# #
5-
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
6-
# WRITTEN BY: Michael Brockus. #
7-
# #
8-
# License: MIT #
9-
# #
10-
###################################################################################
11-
12-
13-
1+
#
2+
# build script written by : Michael Brockus.
3+
# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams.
4+
#
5+
# license: MIT
6+
#
147
project('unity', 'c',
15-
license : 'MIT',
16-
meson_version : '>=0.50.0',
17-
default_options: ['warning_level=3', 'werror=true', 'c_std=c11']
8+
license: 'MIT',
9+
meson_version: '>=0.53.0',
10+
default_options: ['layout=flat', 'warning_level=3', 'werror=true', 'c_std=c11']
1811
)
1912
lang = 'c'
2013
cc = meson.get_compiler(lang)
2114

22-
23-
##
2415
#
2516
# Meson: Add compiler flags
26-
#
27-
##
2817
if cc.get_id() == 'clang'
2918
add_project_arguments(cc.get_supported_arguments(
3019
[
31-
'-Wcast-qual', '-Wshadow', '-Wcast-align', '-Wweak-vtables',
32-
'-Wold-style-cast', '-Wpointer-arith', '-Wconversion',
33-
'-Wexit-time-destructors', '-Wglobal-constructors',
34-
'-Wmissing-noreturn', '-Wmissing-prototypes', '-Wno-missing-braces'
20+
'-Wexit-time-destructors',
21+
'-Wglobal-constructors',
22+
'-Wmissing-prototypes',
23+
'-Wmissing-noreturn',
24+
'-Wno-missing-braces',
25+
'-Wold-style-cast', '-Wpointer-arith', '-Wweak-vtables',
26+
'-Wcast-align', '-Wconversion', '-Wcast-qual', '-Wshadow'
3527
]
3628
), language: lang)
3729
endif
@@ -44,23 +36,13 @@ if cc.get_argument_syntax() == 'gcc'
4436
'-Wno-parentheses' , '-Wno-type-limits' ,
4537
'-Wformat-security' , '-Wunreachable-code' ,
4638
'-Waggregate-return' , '-Wformat-nonliteral' ,
47-
'-Wmissing-prototypes' , '-Wold-style-definition' ,
4839
'-Wmissing-declarations', '-Wmissing-include-dirs' ,
49-
'-Wno-unused-parameter' , '-Wdeclaration-after-statement'
50-
]
51-
), language: lang)
52-
endif
53-
54-
if cc.get_id() == 'msvc'
55-
add_project_arguments(cc.get_supported_arguments(
56-
[
57-
'/w44265', '/w44061', '/w44062',
58-
'/wd4018', '/wd4146', '/wd4244',
59-
'/wd4305', '/D _CRT_SECURE_NO_WARNINGS'
40+
'-Wno-unused-parameter'
6041
]
6142
), language: lang)
6243
endif
6344

45+
#
46+
# Sub directory to project source code
6447
subdir('src')
65-
6648
unity_dep = declare_dependency(link_with: unity_lib, include_directories: unity_dir)

src/meson.build

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
###################################################################################
2-
# #
3-
# NAME: meson.build #
4-
# #
5-
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
6-
# WRITTEN BY: Michael Brockus. #
7-
# #
8-
# License: MIT #
9-
# #
10-
###################################################################################
11-
1+
#
2+
# build script written by : Michael Brockus.
3+
# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams.
4+
#
5+
# license: MIT
6+
#
127
unity_dir = include_directories('.')
138

149
unity_lib = static_library(meson.project_name(),

0 commit comments

Comments
 (0)