未验证 提交 c2c42ce1 编写于 作者: M Michael Brockus 提交者: GitHub

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.
上级 46263fc1
...@@ -15,61 +15,54 @@ project('unity', 'c', ...@@ -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')
...@@ -77,4 +70,4 @@ subdir('src') ...@@ -77,4 +70,4 @@ subdir('src')
unity_dep = declare_dependency( unity_dep = declare_dependency(
version: meson.project_version(), version: meson.project_version(),
link_with: unity_lib, link_with: unity_lib,
include_directories: unity_dir) include_directories: unity_dir)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册