diff options
author | aqua <aqua@iserlohn-fortress.net> | 2023-10-08 19:50:00 +0300 |
---|---|---|
committer | aqua <aqua@iserlohn-fortress.net> | 2023-11-27 21:02:22 +0200 |
commit | fc13fb2ba5993d06d9d6ae5e80bc337aebbdc119 (patch) | |
tree | 9607ab4d5f1d4069d4f761a0b25eada36088bd6b /meson | |
parent | rules.mk: make include paths absolute (diff) | |
download | kernel-fc13fb2ba5993d06d9d6ae5e80bc337aebbdc119.tar.xz |
Use meson build system
Diffstat (limited to 'meson')
-rw-r--r-- | meson/compiler_flags/meson.build | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/meson/compiler_flags/meson.build b/meson/compiler_flags/meson.build new file mode 100644 index 0000000..f159eb4 --- /dev/null +++ b/meson/compiler_flags/meson.build @@ -0,0 +1,34 @@ +# global compiler settings +common_compiler_flags = [ + '-Wshadow', + '-Wunused', '-Wunused-parameter', + '-Wmisleading-indentation', + '-Wundef', + '-Wuninitialized', + # casts + '-Wcast-align', # performance problem casts + '-Wcast-qual', + # conversion + '-Wconversion', # type conversion may lose data + '-Wsign-conversion', # sign conversion + '-Wdouble-promotion', # implicit float to double + # pointers + '-Wpointer-arith', + '-Wnull-dereference', +] +c_compiler_flags = [ + '-fanalyzer', +] +cpp_compiler_flags = [ + '-Weffc++', + # inheritance + '-Wnon-virtual-dtor', # class with virtual functions has non-virt dtor + '-Woverloaded-virtual', # overloaded (not override) virtual function + # casts + '-Wold-style-cast', # C-style casts +] +add_project_arguments(common_compiler_flags, c_compiler_flags, language: 'c') +add_project_arguments(common_compiler_flags, cpp_compiler_flags, language: 'cpp') +add_project_arguments('-D__ARCH__=i686', language: 'c', native: false) + +subdir_done() |