Commit b32b08a0 authored by Dorota Czaplejewicz's avatar Dorota Czaplejewicz
Browse files

Add compiler flags

- warnings
- stack protector
- C standard GNU11
parent a443f522
......@@ -4,11 +4,51 @@ project(
version: '0.0.3',
license: 'MIT',
meson_version: '>=0.43.0',
default_options: [ 'warning_level=1', 'c_std=gnu11' ]
)
if get_option('buildtype').startswith('debug')
add_project_arguments('-DDEBUG', language : 'c')
add_project_arguments('-DDEBUG', language : 'c')
endif
if get_option('buildtype') != 'plain'
add_project_arguments('-fstack-protector-strong', language: 'c')
endif
add_project_arguments([
'-Wcast-align',
'-Wdate-time',
['-Werror=format-security', '-Werror=format=2'],
'-Wendif-labels',
'-Werror=incompatible-pointer-types',
'-Werror=missing-declarations',
'-Werror=overflow',
'-Werror=return-type',
'-Werror=shift-count-overflow',
'-Werror=shift-overflow=2',
'-Werror=implicit-fallthrough=3',
'-Wfloat-equal',
'-Wformat-nonliteral',
'-Wformat-security',
'-Winit-self',
'-Wmaybe-uninitialized',
'-Wmissing-field-initializers',
'-Wmissing-include-dirs',
'-Wmissing-noreturn',
'-Wnested-externs',
'-Wno-missing-field-initializers',
'-Wno-sign-compare',
'-Wno-strict-aliasing',
'-Wno-unused-parameter',
'-Wold-style-definition',
'-Wpointer-arith',
'-Wredundant-decls',
'-Wshadow',
'-Wstrict-prototypes',
'-Wswitch-default',
'-Wswitch-enum',
'-Wtype-limits',
'-Wundef',
'-Wunused-function',
], language: 'c')
cc = meson.get_compiler('c')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment