Skip to content

Commit ff4fe9d

Browse files
committed
meson: Properly check dependencies of mkosi target
Let's insist on mkosi being found if the integration-tests option is enabled and let's only add dependencies on systemd-journal-remote and systemd-measure if they're being built. Drop ukify from the list as its part of public_programs.
1 parent a721b93 commit ff4fe9d

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

meson.build

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ meson_build_sh = find_program('tools/meson-build.sh')
321321
want_tests = get_option('tests')
322322
slow_tests = want_tests != 'false' and get_option('slow-tests')
323323
fuzz_tests = want_tests != 'false' and get_option('fuzz-tests')
324+
integration_tests = want_tests != 'false' and get_option('integration-tests')
324325
install_tests = want_tests != 'false' and get_option('install-tests')
325326

326327
if add_languages('cpp', native : false, required : fuzzer_build)
@@ -2574,6 +2575,18 @@ endif
25742575
#####################################################################
25752576

25762577
mkosi = find_program('mkosi', required : false)
2578+
if integration_tests and not mkosi.found()
2579+
error('Could not find mkosi which is required to run the integration tests')
2580+
endif
2581+
2582+
mkosi_depends = public_programs
2583+
2584+
foreach executable : ['systemd-journal-remote', 'systemd-measure']
2585+
if executable in executables_by_name
2586+
mkosi_depends += [executables_by_name[executable]]
2587+
endif
2588+
endforeach
2589+
25772590
if mkosi.found()
25782591
custom_target('mkosi',
25792592
build_always_stale : true,
@@ -2588,13 +2601,9 @@ if mkosi.found()
25882601
'--build-dir', meson.current_build_dir() / 'mkosi.builddir',
25892602
'--force',
25902603
'--debug',
2591-
'build'
2592-
],
2593-
depends : public_programs + [
2594-
executables_by_name['systemd-journal-remote'],
2595-
executables_by_name['systemd-measure'],
2596-
ukify,
2604+
'build',
25972605
],
2606+
depends : mkosi_depends,
25982607
)
25992608
endif
26002609

0 commit comments

Comments
 (0)