From 7dbfc4be56f006954f7cc440e2f542b22d004ff6 Mon Sep 17 00:00:00 2001 From: Michael Brockus Date: Tue, 2 Jul 2019 19:57:55 -0700 Subject: [PATCH] Adding root meson.build file. --- meson.build | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 meson.build diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..0c6a344 --- /dev/null +++ b/meson.build @@ -0,0 +1,79 @@ +################################################################################### +# # +# NAME: meson.build # +# # +# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. # +# WRITTEN BY: Michael Brockus. # +# # +# License: MIT # +# # +################################################################################### + + + +project('unity', 'c', + license : 'MIT', + meson_version : '>=0.50.0', + default_options : + [ + 'werror=true', + 'optimization=3', + 'warning_level=3', + 'b_sanitize=address,undefined', + 'b_lto=true', + 'b_lundef=true' + ]) +cc = meson.get_compiler('c') +args_for_langs = 'c' + +if cc.get_id() == 'clang' + add_project_arguments( + '-Wweak-vtables', + '-Wexit-time-destructors', + '-Wglobal-constructors', + '-Wmissing-noreturn', language: args_for_langs) +endif + +if cc.get_argument_syntax() == 'gcc' + add_project_arguments( + '-Wall', + '-Wextra', + '-Wunreachable-code', + '-Wmissing-declarations', + '-Wmissing-prototypes', + '-Wredundant-decls', + '-Wundef', + '-Wwrite-strings', + '-Wformat', + '-Wformat-nonliteral', + '-Wformat-security', + '-Wold-style-definition', + '-Winit-self', + '-Wmissing-include-dirs', + '-Waddress', + '-Waggregate-return', + '-Wno-multichar', + '-Wdeclaration-after-statement', + '-Wvla', + '-Wpointer-arith',language: args_for_langs) +endif + +if cc.get_id() == 'msvc' + add_project_arguments( + '/W4', + '/w44265', + '/w44061', + '/w44062', + '/wd4018', # implicit signed/unsigned conversion + '/wd4146', # unary minus on unsigned (beware INT_MIN) + '/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 + +subdir('src') + +unity_dep = declare_dependency( + version: meson.project_version(), + link_with: unity_lib, + include_directories: unity_dir)