build: make tests optional

Add a meson option -Dtests and --without-tests automake option
to disable the compilation of all available testcases.
This is useful for compiling projects with Flatpak such as
GNOME Control Center which disables all possible integrations since they
only need the DBus part of ModemManager.

Contributes to https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1392
This commit is contained in:
Dylan Van Assche
2022-07-25 09:18:29 +02:00
parent 041f53af8b
commit ba96ccc615
9 changed files with 57 additions and 10 deletions

View File

@@ -3,7 +3,9 @@
# DBus Introspection files
mm_ifaces_all = files('all.xml')
mm_ifaces_test = files('tests/org.freedesktop.ModemManager1.Test.xml')
if enable_tests
mm_ifaces_test = files('tests/org.freedesktop.ModemManager1.Test.xml')
endif
mm_ifaces = files('org.freedesktop.ModemManager1.xml')