mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-29 11:14:27 +01:00
Update meson.build
Cleaned up compiler flags in root meson.build, renamed a variable and removed 'c_std=<standard version>' because Meson sets C standard flag to C11 by default.
This commit is contained in:
83
meson.build
83
meson.build
@@ -15,61 +15,54 @@ project('unity', 'c',
|
|||||||
version : '2.4.3',
|
version : '2.4.3',
|
||||||
license : 'MIT',
|
license : 'MIT',
|
||||||
meson_version : '>=0.50.0',
|
meson_version : '>=0.50.0',
|
||||||
default_options :
|
default_options: [
|
||||||
[
|
'buildtype=minsize',
|
||||||
'werror=true',
|
|
||||||
'optimization=3',
|
'optimization=3',
|
||||||
'warning_level=3',
|
'warning_level=3',
|
||||||
'b_sanitize=address,undefined',
|
'werror=true',
|
||||||
'b_lto=true',
|
]
|
||||||
'b_lundef=true'
|
)
|
||||||
])
|
lang = 'c'
|
||||||
cc = meson.get_compiler('c')
|
cc = meson.get_compiler(lang)
|
||||||
args_for_langs = 'c'
|
|
||||||
|
|
||||||
|
|
||||||
|
##
|
||||||
|
#
|
||||||
|
# Meson: Add compiler flags
|
||||||
|
#
|
||||||
|
##
|
||||||
if cc.get_id() == 'clang'
|
if cc.get_id() == 'clang'
|
||||||
add_project_arguments(
|
add_project_arguments(cc.get_supported_arguments(
|
||||||
'-Wweak-vtables',
|
[
|
||||||
'-Wexit-time-destructors',
|
'-Wweak-vtables', '-Wexit-time-destructors',
|
||||||
'-Wglobal-constructors',
|
'-Wglobal-constructors', '-Wmissing-noreturn'
|
||||||
'-Wmissing-noreturn', language: args_for_langs)
|
]
|
||||||
|
), language: lang)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if cc.get_argument_syntax() == 'gcc'
|
if cc.get_argument_syntax() == 'gcc'
|
||||||
add_project_arguments(
|
add_project_arguments(cc.get_supported_arguments(
|
||||||
'-Wall',
|
[
|
||||||
'-Wextra',
|
'-Wformat', '-Waddress', '-Winit-self', '-Wno-multichar',
|
||||||
'-Wunreachable-code',
|
'-Wpointer-arith' , '-Wwrite-strings' ,
|
||||||
'-Wmissing-declarations',
|
'-Wno-parentheses' , '-Wno-type-limits' ,
|
||||||
'-Wmissing-prototypes',
|
'-Wformat-security' , '-Wunreachable-code' ,
|
||||||
'-Wredundant-decls',
|
'-Waggregate-return' , '-Wformat-nonliteral' ,
|
||||||
'-Wundef',
|
'-Wmissing-prototypes' , '-Wold-style-definition' ,
|
||||||
'-Wwrite-strings',
|
'-Wmissing-declarations', '-Wmissing-include-dirs' ,
|
||||||
'-Wformat',
|
'-Wno-unused-parameter' , '-Wdeclaration-after-statement'
|
||||||
'-Wformat-nonliteral',
|
]
|
||||||
'-Wformat-security',
|
), language: lang)
|
||||||
'-Wold-style-definition',
|
|
||||||
'-Winit-self',
|
|
||||||
'-Wmissing-include-dirs',
|
|
||||||
'-Waddress',
|
|
||||||
'-Waggregate-return',
|
|
||||||
'-Wno-multichar',
|
|
||||||
'-Wdeclaration-after-statement',
|
|
||||||
'-Wvla',
|
|
||||||
'-Wpointer-arith',language: args_for_langs)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if cc.get_id() == 'msvc'
|
if cc.get_id() == 'msvc'
|
||||||
add_project_arguments(
|
add_project_arguments(cc.get_supported_arguments(
|
||||||
'/W4',
|
[
|
||||||
'/w44265',
|
'/w44265', '/w44061', '/w44062',
|
||||||
'/w44061',
|
'/wd4018', '/wd4146', '/wd4244',
|
||||||
'/w44062',
|
'/wd4305',
|
||||||
'/wd4018', # implicit signed/unsigned conversion
|
]
|
||||||
'/wd4146', # unary minus on unsigned (beware INT_MIN)
|
), language: lang)
|
||||||
'/wd4244', # lossy type conversion (e.g. double -> int)
|
|
||||||
'/wd4305', # truncating type conversion (e.g. double -> float)
|
|
||||||
mesno.get_supported_arguments(['/utf-8']), language: args_for_langs)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
subdir('src')
|
subdir('src')
|
||||||
|
|||||||
Reference in New Issue
Block a user