meson: update flex/bison requirement to cover all usages

Meson silently drops outputs such as libvulkan-freedreno when
dependencies on flex/bison can't be satisfied rather than providing
an error which this commit fixes.

Signed-off-by: Mark Collins <mark@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21488>
This commit is contained in:
Mark Collins
2023-02-23 12:49:05 +00:00
committed by Marge Bot
parent 61f45a6f44
commit e4ebb541c5

View File

@@ -1775,6 +1775,7 @@ else
endif
yacc_is_bison = true
needs_flex_bison = with_any_opengl or with_freedreno_vk or with_intel_tools or with_gallium
if build_machine.system() == 'windows'
# Prefer the winflexbison versions, they're much easier to install and have
@@ -1786,7 +1787,7 @@ if build_machine.system() == 'windows'
# _fileno functions)
prog_flex = [prog_flex, '--wincompat']
else
prog_flex = [find_program('flex', 'lex', required : with_any_opengl, disabler : true)]
prog_flex = [find_program('flex', 'lex', required : needs_flex_bison, disabler : true)]
endif
# Force flex to use const keyword in prototypes, as relies on __cplusplus or
# __STDC__ macro to determine whether it's safe to use const keyword
@@ -1801,13 +1802,13 @@ if build_machine.system() == 'windows'
prog_bison = find_program('win_bison', required : false)
if not prog_bison.found()
prog_bison = find_program('bison', 'yacc', required : with_any_opengl, disabler : true)
prog_bison = find_program('bison', 'yacc', required : needs_flex_bison, disabler : true)
endif
else
prog_bison = find_program('bison', required : false)
if not prog_bison.found()
prog_bison = find_program('byacc', required : with_any_opengl, disabler : true)
prog_bison = find_program('byacc', required : needs_flex_bison, disabler : true)
yacc_is_bison = false
endif
@@ -1818,7 +1819,7 @@ else
prog_bison = [prog_bison, '-Wno-deprecated']
endif
prog_flex = find_program('flex', required : with_any_opengl, disabler : true)
prog_flex = find_program('flex', required : needs_flex_bison, disabler : true)
prog_flex_cpp = prog_flex
endif