build: Require GIR to be created to run tests

This commit is contained in:
Bastien Nocera 2021-09-07 15:26:07 +02:00
parent 9035db94fc
commit b68fe26fc9
2 changed files with 3 additions and 4 deletions

View file

@ -88,7 +88,5 @@ if gobject_introspection.found()
], ],
install : true) install : true)
gir_dep = declare_dependency(sources: gir) libupower_glib_typelib = gir[1]
else
gir_dep = dependency('', required: false)
endif endif

View file

@ -116,7 +116,7 @@ test(
# On Linux, we can run the additional integration test; # On Linux, we can run the additional integration test;
# defined here as we would have a circular dependency otherwise. # defined here as we would have a circular dependency otherwise.
if os_backend == 'linux' and gir_dep.found() if os_backend == 'linux' and gobject_introspection.found()
env = environment() env = environment()
env.prepend('top_builddir', join_paths(meson.build_root())) env.prepend('top_builddir', join_paths(meson.build_root()))
env.prepend('LD_LIBRARY_PATH', join_paths(meson.build_root(), 'libupower-glib')) env.prepend('LD_LIBRARY_PATH', join_paths(meson.build_root(), 'libupower-glib'))
@ -134,6 +134,7 @@ if os_backend == 'linux' and gir_dep.found()
python3, python3,
args: ut_args, args: ut_args,
env: env, env: env,
depends: [ libupower_glib_typelib, upowerd ],
) )
endforeach endforeach
endif endif