meson: enable compiler flags for warnings, if supported

Use the same set of warning flags that pipewire uses

See #20
This commit is contained in:
George Kiagiadakis 2020-12-20 22:12:11 +02:00
parent e0e2e3920e
commit bb9b59181b

View file

@ -47,15 +47,29 @@ build_gir = gir.found()
wp_lib_include_dir = include_directories('lib')
common_flags = [
'-fvisibility=hidden',
'-Wsuggest-attribute=format',
'-Wsign-compare',
'-Wpointer-arith',
'-Wpointer-sign',
'-Wformat',
'-Wformat-security',
'-Wimplicit-fallthrough',
'-Wmissing-braces',
'-Wtype-limits',
'-Wvariadic-macros',
'-Wno-missing-field-initializers',
'-Wno-unused-parameter',
'-Wno-pedantic',
'-Wold-style-declaration',
'-Wunused-result',
]
cc = meson.get_compiler('c')
if cc.has_argument('-fvisibility=hidden')
add_project_arguments('-fvisibility=hidden', language: 'c')
endif
add_project_arguments(cc.get_supported_arguments(common_flags), language: 'c')
ccpp = meson.get_compiler('cpp')
if ccpp.has_argument('-fvisibility=hidden')
add_project_arguments('-fvisibility=hidden', language: 'cpp')
endif
add_project_arguments(ccpp.get_supported_arguments(common_flags), language: 'cpp')
have_audiofade = cc.compiles('''
#include <spa/utils/names.h>