meson: Don't include glsl compiler if flex/bison aren't found

Use a disabler for not-found, which causes the GLSL targets to simply
not be generated if the tools don't exist.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17724>
This commit is contained in:
Jesse Natalie
2022-07-22 15:47:46 -07:00
committed by Marge Bot
parent 5ee3212078
commit 1df92ed2a6

View File

@@ -1938,7 +1938,7 @@ if build_machine.system() == 'windows'
# _fileno functions) # _fileno functions)
prog_flex = [prog_flex, '--wincompat'] prog_flex = [prog_flex, '--wincompat']
else else
prog_flex = [find_program('flex', 'lex', required : with_any_opengl)] prog_flex = [find_program('flex', 'lex', required : with_any_opengl, disabler : true)]
endif endif
# Force flex to use const keyword in prototypes, as relies on __cplusplus or # 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 # __STDC__ macro to determine whether it's safe to use const keyword
@@ -1953,13 +1953,13 @@ if build_machine.system() == 'windows'
prog_bison = find_program('win_bison', required : false) prog_bison = find_program('win_bison', required : false)
if not prog_bison.found() if not prog_bison.found()
prog_bison = find_program('bison', 'yacc', required : with_any_opengl) prog_bison = find_program('bison', 'yacc', required : with_any_opengl, disabler : true)
endif endif
else else
prog_bison = find_program('bison', required : false) prog_bison = find_program('bison', required : false)
if not prog_bison.found() if not prog_bison.found()
prog_bison = find_program('byacc', required : with_any_opengl) prog_bison = find_program('byacc', required : with_any_opengl, disabler : true)
yacc_is_bison = false yacc_is_bison = false
endif endif
@@ -1970,7 +1970,7 @@ else
prog_bison = [prog_bison, '-Wno-deprecated'] prog_bison = [prog_bison, '-Wno-deprecated']
endif endif
prog_flex = find_program('flex', required : with_any_opengl) prog_flex = find_program('flex', required : with_any_opengl, disabler : true)
prog_flex_cpp = prog_flex prog_flex_cpp = prog_flex
endif endif