| 1 |
# |
| 2 |
# build script written by : Michael Brockus. |
| 3 |
# github repo author: Mark VanderVoord. |
| 4 |
# |
| 5 |
# license: MIT |
| 6 |
# |
| 7 |
project('CException', 'c', |
| 8 |
license: 'MIT', |
| 9 |
meson_version: '>=0.53.0', |
| 10 |
default_options: ['layout=flat', 'warning_level=3', 'werror=true', 'c_std=c11'] |
| 11 |
) |
| 12 |
lang = 'c' |
| 13 |
cc = meson.get_compiler(lang) |
| 14 |
|
| 15 |
# |
| 16 |
# Meson: Add compiler flags |
| 17 |
if cc.get_id() == 'clang' |
| 18 |
add_project_arguments(cc.get_supported_arguments( |
| 19 |
[ |
| 20 |
'-Wexit-time-destructors', |
| 21 |
'-Wglobal-constructors', |
| 22 |
'-Wmissing-prototypes', |
| 23 |
'-Wmissing-noreturn', |
| 24 |
'-Wno-missing-braces', |
| 25 |
'-Wold-style-cast', '-Wpointer-arith', '-Wweak-vtables', |
| 26 |
'-Wcast-align', '-Wconversion', '-Wcast-qual', '-Wshadow' |
| 27 |
] |
| 28 |
), language: lang) |
| 29 |
endif |
| 30 |
|
| 31 |
if cc.get_argument_syntax() == 'gcc' |
| 32 |
add_project_arguments(cc.get_supported_arguments( |
| 33 |
[ |
| 34 |
'-Wformat', '-Waddress', '-Winit-self', '-Wno-multichar', |
| 35 |
'-Wpointer-arith' , '-Wwrite-strings' , |
| 36 |
'-Wno-parentheses' , '-Wno-type-limits' , |
| 37 |
'-Wformat-security' , '-Wunreachable-code' , |
| 38 |
'-Waggregate-return' , '-Wformat-nonliteral' , |
| 39 |
'-Wmissing-declarations', '-Wmissing-include-dirs' , |
| 40 |
'-Wno-unused-parameter' |
| 41 |
] |
| 42 |
), language: lang) |
| 43 |
endif |
| 44 |
|
| 45 |
# |
| 46 |
# Sub directory to project source code |
| 47 |
subdir('lib') |
| 48 |
cexception_dep = declare_dependency(link_with: cexception_lib, include_directories: cexception_dir) |