1################################################################################### 2# # 3# NAME: meson.build # 4# # 5# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. # 6# WRITTEN BY: Michael Brockus. # 7# # 8# License: MIT # 9# # 10################################################################################### 11 12 13 14project('unity', 'c', 15 license : 'MIT', 16 meson_version : '>=0.52.0', 17 default_options: [ 18 'buildtype=minsize', 19 'optimization=3', 20 'warning_level=3', 21 'werror=true', 22 ] 23) 24lang = 'c' 25cc = meson.get_compiler(lang) 26 27 28## 29# 30# Meson: Add compiler flags 31# 32## 33if cc.get_id() == 'clang' 34 add_project_arguments(cc.get_supported_arguments( 35 [ 36 '-Wweak-vtables', '-Wexit-time-destructors', 37 '-Wglobal-constructors', '-Wmissing-noreturn' 38 ] 39 ), language: lang) 40endif 41 42if cc.get_argument_syntax() == 'gcc' 43 add_project_arguments(cc.get_supported_arguments( 44 [ 45 '-Wformat', '-Waddress', '-Winit-self', '-Wno-multichar', 46 '-Wpointer-arith' , '-Wwrite-strings' , 47 '-Wno-parentheses' , '-Wno-type-limits' , 48 '-Wformat-security' , '-Wunreachable-code' , 49 '-Waggregate-return' , '-Wformat-nonliteral' , 50 '-Wmissing-prototypes' , '-Wold-style-definition' , 51 '-Wmissing-declarations', '-Wmissing-include-dirs' , 52 '-Wno-unused-parameter' , '-Wdeclaration-after-statement' 53 ] 54 ), language: lang) 55endif 56 57if cc.get_id() == 'msvc' 58 add_project_arguments(cc.get_supported_arguments( 59 [ 60 '/w44265', '/w44061', '/w44062', 61 '/wd4018', '/wd4146', '/wd4244', 62 '/wd4305', 63 ] 64 ), language: lang) 65endif 66 67subdir('src') 68 69unity_dep = declare_dependency(link_with: unity_lib, include_directories: unity_dir) 70