From e4ebb541c5a16507cdac49922465a985cd89d6f6 Mon Sep 17 00:00:00 2001 From: Mark Collins Date: Thu, 23 Feb 2023 12:49:05 +0000 Subject: [PATCH] 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 Reviewed-by: Eric Engestrom Part-of: --- meson.build | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 4fe0dd6d036..cab995ee13b 100644 --- a/meson.build +++ b/meson.build @@ -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