From d2c5df2f5e37e15a62652ebc4318f6760d90a859 Mon Sep 17 00:00:00 2001 From: Michael Brockus Date: Fri, 20 Sep 2019 16:51:15 -0700 Subject: [PATCH] Adding meson.build script at root directory. --- meson.build | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100755 meson.build diff --git a/meson.build b/meson.build new file mode 100755 index 0000000..f018db6 --- /dev/null +++ b/meson.build @@ -0,0 +1,71 @@ +################################################################################### +# # +# NAME: meson.build # +# # +# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. # +# WRITTEN BY: Michael Brockus. # +# # +# License: MIT # +# # +################################################################################### + + +project('cmock', 'c', + license : 'MIT', + meson_version : '>=0.50.0', + subproject_dir : 'vendor', + default_options: [ + 'buildtype=minsize', + 'optimization=3', + 'warning_level=3', + 'werror=true', + ] +) +lang = 'c' +cc = meson.get_compiler(lang) + + +## +# +# Meson: Add compiler flags +# +## +if cc.get_id() == 'clang' + add_project_arguments(cc.get_supported_arguments( + [ + '-Wweak-vtables', '-Wexit-time-destructors', + '-Wglobal-constructors', '-Wmissing-noreturn' + ] + ), language: lang) +endif + +if cc.get_argument_syntax() == 'gcc' + add_project_arguments(cc.get_supported_arguments( + [ + '-Wformat', '-Waddress', '-Winit-self', '-Wno-multichar', + '-Wpointer-arith' , '-Wwrite-strings' , + '-Wno-parentheses' , '-Wno-type-limits' , + '-Wformat-security' , '-Wunreachable-code' , + '-Waggregate-return' , '-Wformat-nonliteral' , + '-Wmissing-prototypes' , '-Wold-style-definition' , + '-Wmissing-declarations', '-Wmissing-include-dirs' , + '-Wno-unused-parameter' , '-Wdeclaration-after-statement' + ] + ), language: lang) +endif + +if cc.get_id() == 'msvc' + add_project_arguments(cc.get_supported_arguments( + [ + '/w44265', '/w44061', '/w44062', + '/wd4018', '/wd4146', '/wd4244', + '/wd4305', + ] + ), language: lang) +endif + +unity_dep = dependency('unity', fallback: ['unity', 'unity_dep']) + +subdir('src') + +cmock_dep = declare_dependency(link_with: cmock_lib, include_directories: cmock_dir)