mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-08-06 13:50:49 +08:00
clean up meson support
This commit is contained in:
@ -1,14 +1,9 @@
|
|||||||
###################################################################################
|
#
|
||||||
# #
|
# build script written by : Michael Brockus.
|
||||||
# NAME: meson.build #
|
# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams.
|
||||||
# #
|
#
|
||||||
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
|
# license: MIT
|
||||||
# WRITTEN BY: Michael Brockus. #
|
#
|
||||||
# #
|
|
||||||
# License: MIT #
|
|
||||||
# #
|
|
||||||
###################################################################################
|
|
||||||
|
|
||||||
project('example-4', 'c')
|
project('example-4', 'c')
|
||||||
|
|
||||||
unity_dep = dependency('unity', fallback : ['unity', 'unity_dep'])
|
unity_dep = dependency('unity', fallback : ['unity', 'unity_dep'])
|
||||||
|
@ -1,14 +1,9 @@
|
|||||||
###################################################################################
|
#
|
||||||
# #
|
# build script written by : Michael Brockus.
|
||||||
# NAME: meson.build #
|
# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams.
|
||||||
# #
|
#
|
||||||
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
|
# license: MIT
|
||||||
# WRITTEN BY: Michael Brockus. #
|
#
|
||||||
# #
|
|
||||||
# License: MIT #
|
|
||||||
# #
|
|
||||||
###################################################################################
|
|
||||||
|
|
||||||
inc_dir = include_directories('.')
|
inc_dir = include_directories('.')
|
||||||
lib_list = {'a': ['ProductionCode.c' ], 'b': ['ProductionCode2.c']}
|
lib_list = {'a': ['ProductionCode.c' ], 'b': ['ProductionCode2.c']}
|
||||||
|
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
###################################################################################
|
#
|
||||||
# #
|
# build script written by : Michael Brockus.
|
||||||
# NAME: meson.build #
|
# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams.
|
||||||
# #
|
#
|
||||||
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
|
# license: MIT
|
||||||
# WRITTEN BY: Michael Brockus. #
|
#
|
||||||
# #
|
|
||||||
# License: MIT #
|
|
||||||
# #
|
|
||||||
###################################################################################
|
|
||||||
|
|
||||||
subdir('test_runners')
|
subdir('test_runners')
|
||||||
|
@ -1,16 +1,13 @@
|
|||||||
###################################################################################
|
#
|
||||||
# #
|
# build script written by : Michael Brockus.
|
||||||
# NAME: meson.build #
|
# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams.
|
||||||
# #
|
#
|
||||||
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
|
# license: MIT
|
||||||
# WRITTEN BY: Michael Brockus. #
|
#
|
||||||
# #
|
cases = [
|
||||||
# License: MIT #
|
['TestProductionCode_Runner.c', join_paths('..' ,'TestProductionCode.c' )],
|
||||||
# #
|
['TestProductionCode2_Runner.c', join_paths('..' ,'TestProductionCode2.c')]
|
||||||
###################################################################################
|
]
|
||||||
|
|
||||||
cases = [['TestProductionCode_Runner.c', join_paths('..' ,'TestProductionCode.c')],
|
|
||||||
['TestProductionCode2_Runner.c', join_paths('..' ,'TestProductionCode2.c')]]
|
|
||||||
|
|
||||||
test('Running: 01-test-case', executable('01-test-case', cases[0], dependencies: [ a_dep, unity_dep ]))
|
test('Running: 01-test-case', executable('01-test-case', cases[0], dependencies: [ a_dep, unity_dep ]))
|
||||||
test('Running: 02-test-case', executable('02-test-case', cases[1], dependencies: [ b_dep, unity_dep ]))
|
test('Running: 02-test-case', executable('02-test-case', cases[1], dependencies: [ b_dep, unity_dep ]))
|
||||||
|
56
meson.build
56
meson.build
@ -1,37 +1,29 @@
|
|||||||
###################################################################################
|
#
|
||||||
# #
|
# build script written by : Michael Brockus.
|
||||||
# NAME: meson.build #
|
# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams.
|
||||||
# #
|
#
|
||||||
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
|
# license: MIT
|
||||||
# WRITTEN BY: Michael Brockus. #
|
#
|
||||||
# #
|
|
||||||
# License: MIT #
|
|
||||||
# #
|
|
||||||
###################################################################################
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
project('unity', 'c',
|
project('unity', 'c',
|
||||||
license : 'MIT',
|
license: 'MIT',
|
||||||
meson_version : '>=0.50.0',
|
meson_version: '>=0.53.0',
|
||||||
default_options: ['warning_level=3', 'werror=true', 'c_std=c11']
|
default_options: ['layout=flat', 'warning_level=3', 'werror=true', 'c_std=c11']
|
||||||
)
|
)
|
||||||
lang = 'c'
|
lang = 'c'
|
||||||
cc = meson.get_compiler(lang)
|
cc = meson.get_compiler(lang)
|
||||||
|
|
||||||
|
|
||||||
##
|
|
||||||
#
|
#
|
||||||
# Meson: Add compiler flags
|
# Meson: Add compiler flags
|
||||||
#
|
|
||||||
##
|
|
||||||
if cc.get_id() == 'clang'
|
if cc.get_id() == 'clang'
|
||||||
add_project_arguments(cc.get_supported_arguments(
|
add_project_arguments(cc.get_supported_arguments(
|
||||||
[
|
[
|
||||||
'-Wcast-qual', '-Wshadow', '-Wcast-align', '-Wweak-vtables',
|
'-Wexit-time-destructors',
|
||||||
'-Wold-style-cast', '-Wpointer-arith', '-Wconversion',
|
'-Wglobal-constructors',
|
||||||
'-Wexit-time-destructors', '-Wglobal-constructors',
|
'-Wmissing-prototypes',
|
||||||
'-Wmissing-noreturn', '-Wmissing-prototypes', '-Wno-missing-braces'
|
'-Wmissing-noreturn',
|
||||||
|
'-Wno-missing-braces',
|
||||||
|
'-Wold-style-cast', '-Wpointer-arith', '-Wweak-vtables',
|
||||||
|
'-Wcast-align', '-Wconversion', '-Wcast-qual', '-Wshadow'
|
||||||
]
|
]
|
||||||
), language: lang)
|
), language: lang)
|
||||||
endif
|
endif
|
||||||
@ -44,23 +36,13 @@ if cc.get_argument_syntax() == 'gcc'
|
|||||||
'-Wno-parentheses' , '-Wno-type-limits' ,
|
'-Wno-parentheses' , '-Wno-type-limits' ,
|
||||||
'-Wformat-security' , '-Wunreachable-code' ,
|
'-Wformat-security' , '-Wunreachable-code' ,
|
||||||
'-Waggregate-return' , '-Wformat-nonliteral' ,
|
'-Waggregate-return' , '-Wformat-nonliteral' ,
|
||||||
'-Wmissing-prototypes' , '-Wold-style-definition' ,
|
|
||||||
'-Wmissing-declarations', '-Wmissing-include-dirs' ,
|
'-Wmissing-declarations', '-Wmissing-include-dirs' ,
|
||||||
'-Wno-unused-parameter' , '-Wdeclaration-after-statement'
|
'-Wno-unused-parameter'
|
||||||
]
|
|
||||||
), language: lang)
|
|
||||||
endif
|
|
||||||
|
|
||||||
if cc.get_id() == 'msvc'
|
|
||||||
add_project_arguments(cc.get_supported_arguments(
|
|
||||||
[
|
|
||||||
'/w44265', '/w44061', '/w44062',
|
|
||||||
'/wd4018', '/wd4146', '/wd4244',
|
|
||||||
'/wd4305', '/D _CRT_SECURE_NO_WARNINGS'
|
|
||||||
]
|
]
|
||||||
), language: lang)
|
), language: lang)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
#
|
||||||
|
# Sub directory to project source code
|
||||||
subdir('src')
|
subdir('src')
|
||||||
|
|
||||||
unity_dep = declare_dependency(link_with: unity_lib, include_directories: unity_dir)
|
unity_dep = declare_dependency(link_with: unity_lib, include_directories: unity_dir)
|
||||||
|
@ -1,14 +1,9 @@
|
|||||||
###################################################################################
|
#
|
||||||
# #
|
# build script written by : Michael Brockus.
|
||||||
# NAME: meson.build #
|
# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams.
|
||||||
# #
|
#
|
||||||
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
|
# license: MIT
|
||||||
# WRITTEN BY: Michael Brockus. #
|
#
|
||||||
# #
|
|
||||||
# License: MIT #
|
|
||||||
# #
|
|
||||||
###################################################################################
|
|
||||||
|
|
||||||
unity_dir = include_directories('.')
|
unity_dir = include_directories('.')
|
||||||
|
|
||||||
unity_lib = static_library(meson.project_name(),
|
unity_lib = static_library(meson.project_name(),
|
||||||
|
Reference in New Issue
Block a user