mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
meson: let meson detect supported compiler flags
This commit is contained in:
parent
57a9e82f79
commit
3ba73bde48
1 changed files with 31 additions and 41 deletions
72
meson.build
72
meson.build
|
|
@ -60,49 +60,39 @@ pipewire_headers_dir = join_paths(pipewire_name, 'pipewire')
|
|||
gnome = import('gnome')
|
||||
pkgconfig = import('pkgconfig')
|
||||
|
||||
have_cpp = add_languages('cpp', required : false)
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
|
||||
if cc.get_id() == 'gcc'
|
||||
add_global_arguments('-fvisibility=hidden',
|
||||
'-Wsign-compare',
|
||||
'-Wpointer-arith',
|
||||
'-Wpointer-sign',
|
||||
'-Wformat',
|
||||
'-Wformat-security',
|
||||
'-Werror=suggest-attribute=format',
|
||||
'-Wmissing-braces',
|
||||
'-Wtype-limits',
|
||||
'-Wold-style-declaration',
|
||||
'-Wvariadic-macros',
|
||||
'-Wno-missing-field-initializers',
|
||||
'-Wno-unused-parameter',
|
||||
'-Wno-pedantic',
|
||||
'-Wunused-result',
|
||||
'-DFASTPATH',
|
||||
# '-DSPA_DEBUG_MEMCPY',
|
||||
language : 'c')
|
||||
add_global_arguments('-fvisibility=hidden',
|
||||
'-Wsign-compare',
|
||||
'-Wpointer-arith',
|
||||
'-Wformat',
|
||||
'-Wformat-security',
|
||||
'-Werror=suggest-attribute=format',
|
||||
'-Wmissing-braces',
|
||||
'-Wtype-limits',
|
||||
'-Wvariadic-macros',
|
||||
'-Wno-missing-field-initializers',
|
||||
'-Wno-unused-parameter',
|
||||
'-Wno-pedantic',
|
||||
'-Wunused-result',
|
||||
language : 'cpp')
|
||||
# warn on implicit fall-through if supported by compiler (gcc >= 7.x)
|
||||
gcc_major_version = cc.version().split('.')[0]
|
||||
if(gcc_major_version.to_int() >= 7)
|
||||
add_global_arguments('-Wimplicit-fallthrough', language : 'c')
|
||||
add_global_arguments('-Wimplicit-fallthrough', language : 'cpp')
|
||||
endif
|
||||
common_flags = [
|
||||
'-fvisibility=hidden',
|
||||
'-Werror=suggest-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_flags = common_flags + [
|
||||
'-DFASTPATH',
|
||||
# '-DSPA_DEBUG_MEMCPY',
|
||||
]
|
||||
add_project_arguments(cc.get_supported_arguments(cc_flags), language: 'c')
|
||||
|
||||
have_cpp = add_languages('cpp', required : false)
|
||||
|
||||
if have_cpp
|
||||
cxx = meson.get_compiler('cpp')
|
||||
cxx_flags = common_flags
|
||||
add_project_arguments(cxx.get_supported_arguments(cxx_flags), language: 'cpp')
|
||||
endif
|
||||
|
||||
sse_args = '-msse'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue