meson: Build tests conditionally

It's useful downstream to be able to control building
tests, as there's not much use building them if we're
not going to run them.

Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James 2021-09-14 05:07:41 +01:00 committed by George Kiagiadakis
parent 640b6b217c
commit 3b24c419b4
2 changed files with 6 additions and 1 deletions

View file

@ -109,4 +109,7 @@ subdir('lib')
subdir('docs')
subdir('modules')
subdir('src')
subdir('tests')
if get_option('tests')
subdir('tests')
endif

View file

@ -24,3 +24,5 @@ option('systemd-user-unit-dir',
description : 'Directory for user systemd units')
option('glib-supp', type : 'string', value : '',
description: 'The glib.supp valgrind suppressions file to be used when running valgrind')
option('tests', type : 'boolean', value : 'true',
description : 'Build the test suite')