meson: Enable -Wno-deprecated only for bison > 2.3.
authorVinson Lee <vlee@freedesktop.org>
Fri, 28 Feb 2020 05:01:55 +0000 (21:01 -0800)
committerVinson Lee <vlee@freedesktop.org>
Mon, 2 Mar 2020 02:13:52 +0000 (18:13 -0800)
Older versions of bison do not support the -W option.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2571
Fixes: 11a1cb2fa8da ("meson: Disable bison's -Wdeprecated since we still support old bison.")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3993>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3993>

meson.build

index d69b17bb1579962f3e92f8335f1494df6a8779a7..1484e7fec5d85a9b65ea6225009b594ac496a731 100644 (file)
@@ -1512,7 +1512,9 @@ else
   # Disable deprecated keyword warnings, since we have to use them for
   # old-bison compat.  See discussion in
   # https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2161
-  prog_bison = [prog_bison, '-Wno-deprecated']
+  if meson.version().version_compare('>= 0.52.0') and find_program('bison', required : false, version : '> 2.3').found()
+    prog_bison = [prog_bison, '-Wno-deprecated']
+  endif
 
   prog_flex = find_program('flex', required : with_any_opengl)
 endif