mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 11:40:10 +01:00
meson: merge C and C++ compiler arguments check
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
This commit is contained in:
parent
880c1718b6
commit
cb2ddcefa5
1 changed files with 6 additions and 11 deletions
17
meson.build
17
meson.build
|
|
@ -764,7 +764,9 @@ if ['linux', 'cygwin'].contains(host_machine.system())
|
||||||
pre_args += '-D_GNU_SOURCE'
|
pre_args += '-D_GNU_SOURCE'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Check for generic C arguments
|
# Check for generic C/C++ arguments
|
||||||
|
cpp = meson.get_compiler('cpp')
|
||||||
|
cpp_args = []
|
||||||
c_args = []
|
c_args = []
|
||||||
foreach a : ['-Wall', '-Werror=implicit-function-declaration',
|
foreach a : ['-Wall', '-Werror=implicit-function-declaration',
|
||||||
'-Werror=missing-prototypes', '-fno-math-errno',
|
'-Werror=missing-prototypes', '-fno-math-errno',
|
||||||
|
|
@ -772,22 +774,15 @@ foreach a : ['-Wall', '-Werror=implicit-function-declaration',
|
||||||
if cc.has_argument(a)
|
if cc.has_argument(a)
|
||||||
c_args += a
|
c_args += a
|
||||||
endif
|
endif
|
||||||
|
if cpp.has_argument(a)
|
||||||
|
cpp_args += a
|
||||||
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
c_vis_args = []
|
c_vis_args = []
|
||||||
if cc.has_argument('-fvisibility=hidden')
|
if cc.has_argument('-fvisibility=hidden')
|
||||||
c_vis_args += '-fvisibility=hidden'
|
c_vis_args += '-fvisibility=hidden'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Check for generic C++ arguments
|
|
||||||
cpp = meson.get_compiler('cpp')
|
|
||||||
cpp_args = []
|
|
||||||
foreach a : ['-Wall', '-fno-math-errno', '-fno-trapping-math',
|
|
||||||
'-Qunused-arguments']
|
|
||||||
if cpp.has_argument(a)
|
|
||||||
cpp_args += a
|
|
||||||
endif
|
|
||||||
endforeach
|
|
||||||
|
|
||||||
# For some reason, the test for -Wno-foo always succeeds with gcc, even if the
|
# For some reason, the test for -Wno-foo always succeeds with gcc, even if the
|
||||||
# option is not supported. Hence, check for -Wfoo instead.
|
# option is not supported. Hence, check for -Wfoo instead.
|
||||||
if cpp.has_argument('-Wnon-virtual-dtor')
|
if cpp.has_argument('-Wnon-virtual-dtor')
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue