From fc13fb2ba5993d06d9d6ae5e80bc337aebbdc119 Mon Sep 17 00:00:00 2001 From: aqua Date: Sun, 8 Oct 2023 19:50:00 +0300 Subject: Use meson build system --- meson/compiler_flags/meson.build | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 meson/compiler_flags/meson.build (limited to 'meson') 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() -- cgit v1.2.1