build: Use the compact dependency() form for mutest
We can use `disabler: true` to handle the missing subproject state.
@@ -27,20 +27,13 @@ installed_test_bindir = join_paths(get_option('prefix'), get_option('libexecdir'
# Make tests conditional on having mutest-1 installed system-wide, or
# available as a subproject
-mutest_dep = dependency('mutest-1', required: false)
-if not mutest_dep.found()
- mutest = subproject('mutest',
- default_options: [ 'static=true', ],
+mutest_dep = dependency('mutest-1',
+ fallback: ['mutest', 'mutest_dep'],
+ default_options: ['static=true'],
required: false,
+ disabler: true,
)
- if mutest.found()
- mutest_dep = mutest.get_variable('mutest_dep')
- else
- mutest_dep = disabler()
- endif
-endif
-
if mutest_dep.found()
foreach unit: unit_tests
wrapper = '@0@.test'.format(unit)
