build: fix -Dtools=false build

When configuring the project, meson fails with:
tests/meson.build:107:27: ERROR: Unknown variable "util_dep"

Declare the util_dep dependency regardless if 'tools' are enabled, so
tests can be built with it.

Fixes: bdc5c8793a ("meson: allow disabling tests")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Marc-André Lureau 2024-11-11 15:07:12 +04:00 committed by David Gibson
parent 267efc7d46
commit 18f4f305fd

View file

@ -61,16 +61,16 @@ version_gen_h = vcs_tag(
subdir('libfdt') subdir('libfdt')
dtc_tools = [] dtc_tools = []
util_dep = declare_dependency(
sources: ['util.c', version_gen_h],
include_directories: '.',
dependencies: libfdt_dep
)
if get_option('tools') if get_option('tools')
flex = find_program('flex', required: true) flex = find_program('flex', required: true)
bison = find_program('bison', required: true) bison = find_program('bison', required: true)
util_dep = declare_dependency(
sources: ['util.c', version_gen_h],
include_directories: '.',
dependencies: libfdt_dep
)
lgen = generator( lgen = generator(
flex, flex,
output: '@PLAINNAME@.lex.c', output: '@PLAINNAME@.lex.c',