build: Add option to turn off tests

St's theme test now requires the libmutter-test library, which is only
built when tests are enabled. Instead of mandating a particular build
configuration in mutter, add a corresponding option in gnome-shell as
well.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1975>
This commit is contained in:
Florian Müllner 2021-09-06 00:57:33 +02:00 committed by Marge Bot
parent 2e8fdcd8f1
commit 0eff22ebcd
3 changed files with 23 additions and 12 deletions

View File

@ -88,7 +88,6 @@ clutter_dep = dependency(clutter_pc, version: mutter_req)
cogl_dep = dependency(cogl_pc, version: mutter_req)
cogl_pango_dep = dependency(cogl_pango_pc, version: mutter_req)
mutter_dep = dependency(libmutter_pc, version: mutter_req)
mutter_test_dep = dependency(libmutter_test_pc, version: mutter_req)
polkit_dep = dependency('polkit-agent-1', version: polkit_req)
startup_dep = dependency('libstartup-notification-1.0', version: startup_req)
ibus_dep = dependency('ibus-1.0', version: ibus_req)
@ -288,9 +287,12 @@ subdir('js')
subdir('src')
subdir('po')
subdir('data')
subdir('tests')
subdir('tools')
if get_option('tests')
subdir('tests')
endif
if get_option('gtk_doc')
subdir('docs/reference')
endif

View File

@ -22,6 +22,12 @@ option('man',
description: 'Generate man pages'
)
option('tests',
type: 'boolean',
value: true,
description: 'Enable tests'
)
option('networkmanager',
type: 'boolean',
value: true,

View File

@ -191,6 +191,8 @@ libst_dep = declare_dependency(link_with: libst,
sources: st_enums[1]
)
if get_option('tests')
mutter_test_dep = dependency(libmutter_test_pc, version: mutter_req)
test_theme = executable('test-theme',
sources: 'test-theme.c',
c_args: st_cflags,
@ -202,6 +204,7 @@ test_theme = executable('test-theme',
test('CSS styling support', test_theme,
workdir: meson.current_source_dir()
)
endif
libst_gir = gnome.generate_gir(libst,
sources: st_gir_sources,