summaryrefslogtreecommitdiff
blob: 2c64ecf6610fcf9d69b27467923f2fab940e14ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
From b9e27e284c481e876370e2eb73f95d0953fb9cda Mon Sep 17 00:00:00 2001
From: Mart Raudsepp <leio@gentoo.org>
Date: Sun, 23 Aug 2020 11:49:44 +0300
Subject: [PATCH] meson: Allow disabling build of tests

Fixes https://gitlab.gnome.org/GNOME/folks/-/issues/121
---
 meson.build       | 21 +++++++++++++--------
 meson_options.txt |  1 +
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/meson.build b/meson.build
index 53d7dcc6..123edb5c 100644
--- a/meson.build
+++ b/meson.build
@@ -54,6 +54,7 @@ folks_backend_dir = get_option('libdir') / 'folks' / '@0@'.format(folks_module_v
 bluez_backend_enabled = get_option('bluez_backend')
 docs_enabled = get_option('docs')
 eds_backend_enabled = get_option('eds_backend')
+tests_enabled = get_option('tests')
 installed_tests_enabled = get_option('installed_tests')
 ofono_backend_enabled = get_option('ofono_backend')
 telepathy_backend_enabled = get_option('telepathy_backend')
@@ -130,13 +131,15 @@ endif
 
 if bluez_backend_enabled
   libebook_dep = dependency('libebook-1.2', version: '>=' + min_eds_version)
-  # Needed for the BlueZ tests
-  pymod = import('python')
-  py_installation = pymod.find_installation('python3',
-    modules: [
-      'dbusmock',
-    ],
-  )
+  if tests_enabled
+    # Needed for the BlueZ tests
+    pymod = import('python')
+    py_installation = pymod.find_installation('python3',
+      modules: [
+        'dbusmock',
+      ],
+    )
+  endif
 endif
 
 if import_tool_enabled
@@ -233,7 +236,9 @@ subdir('tools')
 subdir('po')
 
 # Tests
-subdir('tests')
+if tests_enabled
+  subdir('tests')
+endif
 
 if docs_enabled
   subdir('docs')
diff --git a/meson_options.txt b/meson_options.txt
index 43cd586a..62a9603c 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -11,6 +11,7 @@ option('inspect_tool', type: 'boolean', value: true, description: 'Enable buildi
 # Profiling
 option('profiling', type: 'boolean', value: false, description: 'Enable profiling code')
 # Test options
+option('tests', type: 'boolean', value: true, description: 'Build tests programs')
 option('installed_tests', type: 'boolean', value: false, description: 'Install test programs')
 # Docs
 option('docs', type: 'boolean', value: false, description: 'Enable documentation generation')
-- 
2.20.1