meson: add -Dtests=false|true option

When set to false, no test binaries are neither built, nor
executed (with “ninja test”).

Closes #919
This commit is contained in:
Daniel Eklöf 2022-02-06 12:51:54 +01:00
parent 1eef5a00e6
commit 55d0ab00a6
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 15 additions and 1 deletions

View file

@ -38,7 +38,15 @@
## Unreleased
### Added
* `-Dtests=false|true` meson command line option. When disabled, test
binaries will neither be built, nor will `ninja test` attempt to
execute them. Enabled by default
(https://codeberg.org/dnkl/foot/issues/919).
### Changed
### Deprecated
### Removed

View file

@ -283,7 +283,10 @@ endif
subdir('completions')
subdir('icons')
if (get_option('tests'))
subdir('tests')
endif
summary(
{
@ -295,6 +298,7 @@ summary(
'Terminfo install location': terminfo_install_location,
'Default TERM': get_option('default-terminfo'),
'Set TERMINFO': get_option('custom-terminfo-install-location') != '',
'Tests': get_option('tests'),
},
bool_yn: true
)

View file

@ -10,6 +10,8 @@ option('ime', type: 'boolean', value: true,
option('grapheme-clustering', type: 'feature',
description: 'Enables grapheme clustering using libutf8proc. Requires fcft with harfbuzz support to be useful.')
option('tests', type: 'boolean', value: true, description: 'Build tests')
option('terminfo', type: 'feature', value: 'enabled', description: 'Build and install foot\'s terminfo files.')
option('default-terminfo', type: 'string', value: 'foot',
description: 'Default value of the "term" option in foot.ini.')