Commit 311a368e authored by Christoph Reiter's avatar Christoph Reiter 馃悕

meson: use the same compiler flags as with distutils

parent a96e210c
......@@ -68,13 +68,13 @@ giext = python.extension_module('_gi', sources,
include_directories: include_directories('..'),
install: true,
subdir : 'gi',
c_args: ['-DHAVE_CONFIG_H', '-DPY_SSIZE_T_CLEAN'] + python_no_warn_flags
c_args: ['-DHAVE_CONFIG_H', '-DPY_SSIZE_T_CLEAN'] + main_c_args
)
if pycairo_dep.found()
gicairoext = python.extension_module('_gi_cairo', ['pygi-foreign-cairo.c'],
dependencies : [python_dep, glib_dep, gi_dep, ffi_dep, pycairo_dep],
c_args: ['-DHAVE_CONFIG_H', '-DPY_SSIZE_T_CLEAN'] + python_no_warn_flags)
c_args: ['-DHAVE_CONFIG_H', '-DPY_SSIZE_T_CLEAN'] + main_c_args)
endif
subdir('overrides')
......
......@@ -16,7 +16,6 @@ pymod = import('python')
python = pymod.find_installation(get_option('python'))
python_dep = python.dependency()
python_no_warn_flags = []
glib_version_req = '>= 2.38.0'
gi_version_req = '>= 1.46.0'
......@@ -47,11 +46,63 @@ endif
cc = meson.get_compiler('c')
supported_arguments = cc.get_supported_arguments([
'-Wno-discarded-qualifiers'])
add_project_arguments(supported_arguments, language: 'c')
main_c_args = [
'-Wall',
'-Warray-bounds',
'-Wcast-align',
'-Wdeclaration-after-statement',
'-Wduplicated-branches',
'-Wextra',
'-Wformat=2',
'-Wformat-nonliteral',
'-Wformat-security',
'-Wimplicit-function-declaration',
'-Winit-self',
'-Winline',
'-Wjump-misses-init',
'-Wlogical-op',
'-Wmissing-declarations',
'-Wmissing-format-attribute',
'-Wmissing-include-dirs',
'-Wmissing-noreturn',
'-Wmissing-prototypes',
'-Wnested-externs',
'-Wnull-dereference',
'-Wold-style-definition',
'-Wpacked',
'-Wpointer-arith',
'-Wrestrict',
'-Wreturn-type',
'-Wshadow',
'-Wsign-compare',
'-Wstrict-aliasing',
'-Wstrict-prototypes',
'-Wundef',
'-Wunused-but-set-variable',
'-Wwrite-strings',
'-Wconversion',
]
main_c_args += [
'-Wno-incompatible-pointer-types-discards-qualifiers',
'-Wno-missing-field-initializers',
'-Wno-unused-parameter',
'-Wno-discarded-qualifiers',
'-Wno-sign-conversion',
]
main_c_args += [
'-fno-strict-aliasing',
'-fvisibility=hidden',
]
if not ['3.3', '3.4'].contains(python.language_version())
main_c_args += [
'-Wswitch-default',
]
endif
main_c_args = cc.get_supported_arguments(main_c_args)
cdata = configuration_data()
......
......@@ -100,7 +100,7 @@ helper_sources = [
helperext = python.extension_module('testhelper', helper_sources,
dependencies : [python_dep, glib_dep, gobject_dep],
c_args: ['-DPY_SSIZE_T_CLEAN'],
c_args: ['-DPY_SSIZE_T_CLEAN'] + main_c_args,
include_directories: include_directories(join_paths('..', 'gi'))
)
......
Markdown is supported
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