From e2dd6a149d41048e6fc29a8f53b19613f0a22db6 Mon Sep 17 00:00:00 2001 From: Micheal Brockus <42789598+squidfarts@users.noreply.github.com> Date: Sat, 31 Aug 2019 19:43:33 -0700 Subject: [PATCH] Created meson.build at root directory. --- meson.build | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 meson.build diff --git a/meson.build b/meson.build new file mode 100644 index 00000000..b7d81030 --- /dev/null +++ b/meson.build @@ -0,0 +1,97 @@ +I ################################################################################### +# # +# NAME: meson.build # +# # +# AUTHOR: Serge Zaitsev. # +# # +# WRITTEN BY: Michael Brockus. # +# # +# CONTACT: # +# # +# NOTICES: # +# # +# License: MIT # +# # +################################################################################### + + + +project('jsmn', 'c', + license : 'MIT', + meson_version : '>=0.50.0', + default_options : + [ + 'b_lundef=true', + 'werror=true', + 'optimization=3', + 'warning_level=3', + 'c_std=c11' + ] +) +cc = meson.get_compiler('c') +args_for_langs = 'c' + + + +## +# +# 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: args_for_langs) +endif + +if cc.get_argument_syntax() == 'gcc' + add_project_arguments( + cc.get_supported_arguments( + [ + '-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', + '-Wno-parentheses', + '-Wno-unused-parameter', + '-Wno-type-limits', + '-Wdeclaration-after-statement', + '-Wvla', + '-Wpointer-arith' + ] + ), language: args_for_langs) +endif + +if cc.get_id() == 'msvc' + add_project_arguments( + cc.get_supported_arguments( + [ + '/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) + ] + ), language: args_for_langs) +endif + +jsmn_dep = declare_dependency(include_directories: include_directories('.'))